• Home
    • Pugpig Site

    Pugpig Site: Google Publisher Tag and Google Ad Manager

    Written by Jon Marks

    Updated at May 7th, 2024

    • Pugpig Bolt

      • Pugpig Site

        • Pugpig Archive

          • Working with Pugpig

            • Pugpig Consulting

              Pugpig Site supports certain aspects of the Google advertising suite.

              Delete

              Google Tag Manager

              Currently we recommend the advertising scripts are included via Google Tag Manager, and should be last so as not to block performance. Please contact us if you would prefer to include the scripts directly.

              High Level Approach

              The JavaScript is included on the page - an example tag is shown below.

              We include divs for the units inside the HTML templates:

              <div id="div-gpt-ad-side-1"></div>

              These are then targeted in Javascript with something like this:

                    googletag.defineSlot('/22758755668/ACME', [[970, 90], [728, 90]], 'div-gpt-ad-side-1').addService(googletag.pubads()));

              Ad Targeting Tags

              Technical Approach

              We will pass all relevant taxonomy terms for targeting:

                      googletag.pubads().setTargeting('section', 'Tax');

              Note: The first value is the slug of the taxonomy, while the second is the name of the term.

              You can see all the values we will pass in the source of the page as pugpig:tag meta tags, for example:

              <meta name="tag" property="pugpig:tag" content="section-Tax"/>

              Tags Used

              We determine the tags to send as follows:

              Content Type Example Tags
              WordPress Pages /
              /cricket
              Normally your home page, manually curated section pages, furniture pages (e.g. subscribe/about us/etc)
              We will send the terms that are associated with the pages. These are normally added manually in the CMS.

              WordPress Posts

              /2022/09/01/my-article.html
              Any articles

              We will send all of the terms for all of the taxonomies of the post. Note that articles could have multiple terms (for example, topic could be News and Sport), in which case we send an array. 


              WordPress Taxonomy Pages
              /section/tax/
              These are automatically created section pages based off a specific taxonomy page
              We will send only the taxonomy that drives the
               page
              Post Grid Plugin Blocks of articles in a grid on a page If you need to show adverts inside a post grid, please get in touch










              ad manager pugpig

              Was this article helpful?

              Yes
              No
              Give feedback about this article

              Related Articles

              • Adding OneTrust / Cookiepro
              • Access to Google Search Console
              • Google Tag Manager for Pugpig Site
              pugpig logo white
              Navigation
              • Products
              • Customers
              • News
              • Podcast
              Contact
              • Contact us
              • LinkedIn
              • Twitter
              Technical Support
              • Status Page
              • Documentation
              • Customer Support
              Corporate
              • Company
              • Jobs
              • Privacy Policy

              © Kaldor Ltd. 2022

              Powered by Pugpig


              Knowledge Base Software powered by Helpjuice

              Expand