Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #1712592
Ad displays / Getting AMP to work
Closed

Comments

  • rzrbrn started the conversation

    I'm trying to get adsense and amazon ads working on the site, have read through all the other tickets on the topic before posting. The documentation that is posted for reformatting the script is either outdated, or Google has changed their format. Here's the adsense code:

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

    This does not have the second variable for [data-ad-slot] - so modifying as documentation states does NOT work.


    Here is the Amazon affiliate code that I am trying to get to work:

    <div class="alignleft">
         <script type="text/javascript">
               amzn_assoc_ad_type = "banner";
        amzn_assoc_marketplace = "amazon";
        amzn_assoc_region = "US";
        amzn_assoc_placement = "assoc_banner_placement_default";
        amzn_assoc_campaigns = "kitchen";
        amzn_assoc_banner_type = "category";
        amzn_assoc_p = "40";
        amzn_assoc_isresponsive = "false";
        amzn_assoc_banner_id = "0496AN2501X6E3T9WK02";
        amzn_assoc_width = "120";
        amzn_assoc_height = "60";
        amzn_assoc_tracking_id = "somethingcool-30";
        amzn_assoc_linkid = "12345678901234567890";
         </script>
         <script src="//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1"></script>
        </div>


    Can this be pasted in after the adsense code in the same box? Also - in other tickets you mention that adsense code is only supported on certain pages - there are data fields on many of the 'customize' menus, not just the Penci AMP settings. Do only part of these function?


    Thank you!

  •  2,700
    PenciDesign replied

    Hi,

    1/ Yeah, that's one example on the documentation. Some google adsense auto ads will doesn't exists [data-ads-slot]. But, that's easy to modify that code for AMP. With your ads, you just need change it to:

    <amp-ad width="300" height="250" type="adsense" data-ad-client="ca-pub-1234567890"></amp-ad>
    

    Dont fill ads slot there.

    Also, if you're use google adsense auto ads, you can check more this guide to know how to config adsense auto ads for your site:

    https://support.google.com/adsense/answer/9011465

    And you can put that code from the guide to Appearance > Customizer AMP ( not Customize ) > Header Options

    2/ Currently, Google doesn't allow custom <script> for AMP pages. So, I recommend you ask amazon affiliate about this about amazon affiliate code for AMP


    Best Regards,

    PenciDesign