I'm hoping someone can help. I'm not familiar with javascript but have a problem. I recently joined Amazon's CPM ad program but the ads aren't displaying on my page. Neither are the passback ads. When I paste the code into a javascript tester it immediately gives an error. Can anyone look at this code and see if there is something wrong with it I can fix? Thank you! <script type="text/javascript" language="javascript" src="//c.amazon-adsystem.com/aax2/getads.js"></script> <script type="text/javascript" language="javascript"> //<![CDATA[ aax_getad_mpb({ "slot_uuid":"e8837a3d-bbbe-4cf9-89c4-7e81d5a029f2" }); //]]> </script> Code (JavaScript):
It should work. Your code works in jsfiddle: https://jsfiddle.net/7kp17sze/1/ I don't know what you're using, the blogger or maybe some CMS, but what happens sometimes is the quotation marks ("") turn into < and > upon saving. When they do, the script won't work. When you view the page source, do you see "" or < > ?
How do you add the code to the site? Do you edit the source files, or are you trying to paste it into an editor-window (like this editor window here in this forum, or the post-window on Wordpress?)
Thanks all. I was able to find a javascript guru like you guys that had the same problem months ago and had resolved it. Turns out there was a wp plugin I was using that was interfering with it. Autoptimize - it's supposed to minimize javascript and css but was messing up the amazon cpm code. I deactivated the plugin and it works perfectly now! I'm still confused as to why when I tested the code in some online javascript testers it didn't work. Hm. Maybe I should use jsfiddle from now on. Thanks all!
Kudos for coming back to your thread and answering your own question - that is how forums should work (but way too often doesn't). This thread is now available and might help others facing the same problem. Great work!
Thanks. If others take the time to help the least I can do is come back and let them know how it was fixed. It helps them learn something new too, right? And, I'm hoping someone in the future searching for a resolution to this issue comes along and this post helps them.