How to embed scripts for advertisers

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>

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?

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.

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

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

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

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.

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

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

1 Like

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?

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

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

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

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

<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.

Great workround :love_you_gesture:

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.

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

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?

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:

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