Skip to content
Public Ticket #2768

Adsense codes

Conversation thread

PenciDesign replied

Staff Reply

Hi,

You don't need for use AMP

Best Regards,

PenciDesign

Empirebridal replied

Customer Reply

Just a question.  Do I have to use AMP?

PenciDesign replied

Staff Reply

Hi,

As I can see, you're using google adsense auto ads on AMP. And you need to do following the guide here:

https://www.ampproject.org/docs/reference/components/amp-auto-ads

1/ Add more this code to Appearance > Customizer AMP > Header Options > Add Custom Code Inside <head> tag

\
<script async="" custom-element="amp-auto-ads" src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js"></script>\

2/ Use this code for google adsense auto ads on AMP by put this code to Appearance > Customizer AMP > Header Options > Add Custom Code After <body> Tag

\
<amp-auto-ads type="adsense" data-ad-client="ca-pub-5439573510495356">\
</amp-auto-ads>\

Note Important: Replace ca-pub-5439573510495356  on the above code to your adsense data-ad-client

Best Regards,

PenciDesign

Empirebridal replied

Customer Reply

Hello...i put in the adsense codes in the amp section as per your instructions.  and I have had Google search come back with the following errors...i've attached a screen shot - How do i fix this?

PenciDesign replied

Staff Reply

Hi,

Yeah, you can - but this apply for the pages is not on AMP.

Best Regards,

PenciDesign

Empirebridal replied

Customer Reply

Sorry another question.  Can you use the Custom HTML widget to place ads in sidebars?

PenciDesign replied

Staff Reply

Hi,

Yes, It's the same.

You should check guide for it here

And put the auto AMP ads codes via Appearance > Customizer AMP > Header Options > Add Custom Codes After <body> Tag

Best Regards,

PenciDesign

Empirebridal replied

Customer Reply

Also the code that Adsense now provides has google_ad_client NOT data-ad-client (see Below)

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-3385377484402476",
    enable_page_level_ads: true
  });
</script>

Will the words need to match the AMP so it reads google ad client and not data ad client?

PenciDesign replied

Staff Reply

Hi,

No problemssmile.pngYou just need use the code like google guide. Let's use the code like this:

\
<amp-auto-ads type="adsense" data-ad-client="ca-pub-5439573510495356">\
</amp-auto-ads>\

Best Regards,

PenciDesign

Empirebridal replied

Customer Reply

Sorry...in your instructions for changing Adwords code for AMP it says to use the 'data-ad-client' and -data-ad-slot' but the code given to me by Adwords, only has the 'data-ad-client' - I have not been given a 'data-ad-slot' number.

It only gives me this:

 google_ad_client: "ca-pub-3385377484402476",
    enable_page_level_ads: true

Empirebridal replied

Customer Reply

Got it! Thanks

PenciDesign replied

Staff Reply

Hi,

Let's check options for ads on AMP via Appearance > Customizer AMP ( NOT "Customize" )smile.png

It's 2 different interfaces - so, of course it has different ads spaces.

Best Regards,

PenciDesign

Empirebridal replied

Customer Reply

Ok thank you.

With header style 3 - I have placed the code in the section provided.  Is there a section for the same spot in the AMP version?

PenciDesign replied

Staff Reply

Hi,

Yeah, you need put for both.

The Appearance > Customizer section for all the pages is not AMP version.

The Appearance > Customizer AMP section for all the AMP pages.

For ads on AMP, please check the note here

Best Regards,

PenciDesign

Empirebridal started the conversation

Conversation Start

Hello, I want to now add Google Adsense codes to my site.  Do I need to add them to the normal Customiser section AND the Penci AMP section?  Or do I only do the Penci AMP section? Thank you Michelle

Want to join this conversation or access attachments? Sign in first.