Reputation: 11
I cannot get amp-auto-ads to display on my website: https://www.dodgecountyfairgrounds.com/2018/02/03/fundraising-underway-to-finish-pig-barn-upgrade/amp/#development=1
I am getting an error: amp-auto-ads config xhr failed: SyntaxError: Unexpected end of JSON input pa @ log.js:162
Can someone tell me exactly where to place all code detailed in this article: https://www.ampproject.org/docs/reference/components/amp-auto-ads
Upvotes: 1
Views: 919
Reputation: 7511
First of all, using amp-auto-ads, the ads will be visible in mobile version only. If you are facing the issue that ads are not visible in mobile version then you can fix it as I did for my website i.e. https://www.wiki11.com.
You will need to go into your adsense account and click on optimization.
Now click on Lab and enable AMP Auto Ads - Text & display. It will provide you some code which you need to copy and paste in head section and just below of body tag. After it, it will take min 20 minutes to enable auto amp ads into your mobile version of webpage. After 20 mins, if you will check then it will display ads.
Upvotes: 1
Reputation: 13469
You may refer with this thread. It stated that AdSense currently only returns a configuration for amp-auto-ads when the request is from a mobile user agent. It is also stated in this link that the error might happen when viewed from a none mobile device.
AMP Auto Ads for AdSense is currently in a beta phase so the option to turn it on within the AdSense UI is not available to all AdSense accounts yet. If the client-side code is implemented without it being enabled in AdSense, then no configuration will be served and the error you see would occur.
We're working hard to make it available to everyone soon and I'll update this bug again once it is. Sorry for the inconvenience.
Hope this helps!
Upvotes: 0