Last Updated on September 21, 2023 by Christopher G Mendla
I am in the process of adding Amazon ads to my sites. The Native ads showed up fine. However, trying to put a product or search ad using an HTML block resulted in a situation where that ad was not showing. The resolution had to do with CloudFlare’s Rocket Launcher.
Overview
I added a Native Shopping ad at the bottom of every post using the Add Widget After Content Plugin. That worked fine.
I wanted to start adding some product ads strategically in certain posts. The process looks simple enough. Create an HTML block and paste the Amazon code in.
The Amazon code is a couple of lines of Javascript. However, the ads simply were not showing up.
Configuration
The general configuration was
- Hosted on Westhost using shared hosting
- Using the free Cloudflare setup offered with the hosting
- WordPress 5.5.3
- Plugins that could affect the ads: Wordfence, WP-Super Cache, Autoptimize.
Initial Troubleshooting
I tried disabling the plugins that I thought could be causing the issue. After each change, I flushed the cache on Cloudflare and the page in Wp Supercache. I also periodically flushed the autoptimize cache.
I also tried other browsers and was going to try using incognito mode and a proxy. I didn’t get to do that.
I tried a Div around the amazon code to no avail.
No combination of changes would allow the Amazon ads to show.
Deep dig.
I started searching for combinations of amazon ads not showing in wordpress -native
I used the `-native’ to exclude problems regarding the Native ads as that was not where I was having an issue.
I found an issue on WordPress.org. This was an issue in an Amazon ads plugin but it pointed me to the solution
It seems you are using CloudFlare and Rocket Loader.
https://wordpress.org/support/topic/no-amazon-ads-showing/
Rocket Loader is known to cause issues with Amazon ads.
Please try to disable it and then flush all caches on your server and on CloudFlare.
I went to Westhost’s CHI control panel and disabled the Rocket Loader. The ads immediately started showing up.
Summary
I am trying to gain every possible bit of performance I can as I’m trying to incubate these sites. When they get enough traffic I’ll upgrade the hosting. Therefore, I’m not that happy about disabling a performance enhancement but, on the other hand, I want to get the ads in place.
I haven’t run any performance tests but I really don’t have a choice at this point if I want to run the Amazon ads, or any other Javascript based ads.
You can add this to the Amazon ad code before the SRC part: data-cfasync=”false”