How to embed scripts for advertisers

#1

New to wappler. If this is in documentation or board, I apologize for not finding it. Thank you to whomever answers.

I have affiliate programs with Booking.com and Amazon. They provide js Scripts that call up products or a graphic with a link. In Dreamweaver I merely posted the script in a card or really any space in the html. Tried doing this in W.(In Code View) but nothing shows up. tried putting it in cards, rows and text areas. Nothing. Here are two examples:

Booking:

<ins class="bookingaff" data-aid="1780100" data-target_aid="1780100" data-prod="banner" data-width="190" data-height="180" data-banner_id="85389" data-lang="xu">
    <!-- Anything inside will go away once widget is loaded. -->
        <a href="//www.booking.com?aid=1780100" rel=”nofollow”><a>Booking.com</a>

Amazon:

<script type="text/javascript">
amzn_assoc_placement = "adunit0";
amzn_assoc_tracking_id = "mexicomike-20";
amzn_assoc_ad_mode = "search";
amzn_assoc_ad_type = "smart";
amzn_assoc_marketplace = "amazon";
amzn_assoc_region = "US";
amzn_assoc_default_search_phrase = "Garmin GPS";
amzn_assoc_default_category = "Automotive";
amzn_assoc_linkid = "8843476b110263cded3a504d00b981d9";
amzn_assoc_title = "Shop Related Products";
amzn_assoc_search_bar = "true";
amzn_assoc_search_bar_position = "top";
amzn_assoc_default_browse_node = "15684181";
</script>
<script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script>
#2

Hello, you should be able to just paste these on your pages.
What’s the issue exactly when you paste them in the code, where you need them?

#3

Thank you for the quick reply. It is the oddest thing. I agree I should be able to just paste the code in. Absolutely nothing happens - there is no change in the page, either on my desktop or after I save and upload.

I am pasting after a /p tag and before a div. I did start a new blank page and pasted between body and /body and got the same result.

Thank you.

#4

But do you see the pasted code in the code view?

Can you provide a link to your page where we can check this?

#5

Thank you. I tried a very simple page to see if it was something i did and get the same results: https://www.mexicomike.com/rewappler/#

This is a page with more features, (ok it is a mess, but I was just trying to learn some features) but the same results: https://www.mexicomike.com/rewappler/index1.html

#6

The following script contains coding errors.

<ins class="bookingaff" data-aid="1780100" data-target_aid="1780100" data-prod="banner" data-width="190" data-height="180" data-banner_id="85389" data-lang="xu">
    <!-- Anything inside will go away once widget is loaded. -->
        <a href="//www.booking.com?aid=1780100" rel=”nofollow”><a>Booking.com</a>

Namely

  1. the <ins> tag has not been closed
  2. nofollow is enclosed by unrecognised double quotes
  3. there is a rogue <a> tag in front of Booking.com

Not sure what the Amazon script is supposed to do. Perhaps if you give us a link to an explanation, we may be able to help you figure it out.

#7

Wow! Thanks, I will look into the errors. Imagine that. Thank you very much. here is a page made with DW with the Amazon script working as well as the Booking one.

The Amazon script is at the bottom of the page. What it does is display a number of items depending on space) of a certain category.

https://www.mexicomike.com/books/lb_intro2.html

#8

The Amazon script will not work when App Connect has been installed.

1 Like
#9

Okey-dokey then. Good to know. Appreciate your time. That is kind of a problem for me, but then why do I need App Connect? Can I disable it or should I?

#10

App Connect is for the client side part of Wappler. I could not do without it.

#11

OK thank you. Since i make part of my income from Amazon will have to think about it. BTW fixed the errors in the booking script and it still didn’t work, so suspect the problem there is with App Connect too.

2 Likes
#12

I hope the Wappler team will fix this for you. For the meantime, I suggest you to put your script on another page (without app connect on it) and use iframe to display your ads on your main page. I tried it on my site and it works.

<iframe src="ads.html" frameborder="0" width="100%" height="600"></iframe>

1 Like
#13

What is the conflict with App Connect, are there JavaScript errors?

#14
<script type="text/javascript">
amzn_assoc_placement = "adunit0";
amzn_assoc_tracking_id = "mexicomike-20";
amzn_assoc_ad_mode = "search";
amzn_assoc_ad_type = "smart";
amzn_assoc_marketplace = "amazon";
amzn_assoc_region = "US";
amzn_assoc_default_search_phrase = "Garmin GPS";
amzn_assoc_default_category = "Automotive";
amzn_assoc_linkid = "8843476b110263cded3a504d00b981d9";
amzn_assoc_title = "Shop Related Products";
amzn_assoc_search_bar = "true";
amzn_assoc_search_bar_position = "top";
amzn_assoc_default_browse_node = "15684181";
</script>
<script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script>

@patrick, copy and test the above code into a new document that has not had App Connect applied to it. Then do the same with an App Connect document and you will see that the former works as intended while the latter does not.

#15

Great workround :love_you_gesture:

#16

After some experimenting it seems that it uses some document.write that is causing problems. Did you also try their async code https://affiliate-program.amazon.com/help/topic/t423?ac-ms-src=recofaqasyncguide.

#17

Sorry all, had to go to hospital yesterday so out of touch. Kind of back to work today. Will try all of y’alls great suggestions and let you know how they worked out. So appreciate the help. A far cry from Adobe!

1 Like
#18

Yep you are right, Ben and Patrick. Works in document without app connect and not in one with. Is there an FAQ or something that would explain App Connect to me so i can see if i actually use it in my applications?

#19

App Connect is the base of all of the components used on your pages. It is required for everything to work properly.
I’d recommend you to start with the basic docs:

#20

Duh, thanks Teodor. I read them before starting but somehow thought App Connect was just one feature and therefore expendable. Sorry to sound like one of those who doesn’t RTM. I realize the answers are often there if one is not lazy. My apologies.

So now that that is settled, i have to use it. I will try the second scuggestion of downloading the async script.

1 Like