help adsense auto ads amp

Posted in: Newspaper
Post count: 57

Hello, can anyone help me implement google’s automatic ads? Google gives me two codes, a script that goes in the header of the site and another one that would be the announcement block that is stuck in the announcements part for amp.

The doubt is that the code that goes in the header is
<script async custom-element = “amp-auto-ads”
        src = “https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js”&gt;
</ script>

But in the personalized code of the mobile theme says this message:

Add custom JavaScript easly, using this editor. Please do not include the <script> </ script> tags.
NOTE: On AMP scripts are not allowed so this is code will not be included on amp templates.

The question is how do I paste this code

<script async custom-element = “amp-auto-ads”
        src = “https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js”&gt;
</ script>

Without using the <script> </ script> tags, or am I implementing it badly?

Can somebody help me?

Post count: 35449

Hi,

You need to set that code for mobile ads in Theme panel>Mobile Theme > AMP Analytics -> https://www.screencast.com/t/eaj9E3xDVRk also the code for desktop need to be set in Theme panel>Analytics -> https://www.screencast.com/t/26SmCckQ

Thank you!

Post count: 57

thanks now it works, but how can I put an adsense ad under the title in the single, ONLY IN AMP?

Post count: 35449

Hi,

Unfortunately, there is no option in mobile theme to set an adsense and to be show only on amp, only for both ( mobile and amp), sorry!
-> https://www.screencast.com/t/KxkKouaWt ( you can set the ads in mobile ads and will be show to amp too ).
Please check this article, maybe this can help you -> https://isabelcastillo.com/google-adsense-wordpress-amp

Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.