These step by step instructions for placing your Google Adsense Code into Google Tag Manager assumes that you already have Google Tag Manager installed and working on your website.
Note, that while it is not best practice to implement Google Adsense Code via Google Tag Manager, it does work if you follow these instructions:
- Click on Variables on the left side of the screen within your GTM workspace
- Create a new user defined variable and call it asClientID
- Configure the variable as a Constant. The value to enter is your AdSense Client ID
- Click on Tags on the left side of the screen within your GTM workspace
- Create a new Tag called AS – Page view – ALL
- Because there is no built-in tag in GTM for AdSense you need to use the Custom HTML tag.
- Copy and Paste the HTML code shown below into GTM.
- Select the trigger All Page views
- Test your changes in preview mode
- Once everything is working publish the changes to LIVE.
Read also: the power of contract Management Dashboards.
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "{{asClientID}}",
enable_page_level_ads: true
});
</script>