Adsense and Google Publisher Tag

Have more questions? Submit a request

If your website uses Google Adsense or Google Publisher Tag to display ads on your website you can now use the iab TCF framework to inherit consent settings and show ads with the corresponding consent settings. 

To make sure your ads are correctly rendered on your website make sure to enable TCF for your cookie banner by following the article. How to enable iab TCF 2.2?

The next step is to make sure that the cookie banner is connected to the Adsense tag or Google Publisher tag. There are 3 options to do this:


1. Edit current tags on your website

Mark up your script tags by connecting the scripts to the advertising category of the banner:

Google Publisher Tag

Your current tag looks like below. 

<script async="async" src=""></script>

Change the tag to this:

<script type="text/plain" data-cookiefirst-category="advertising" data-src=""></script>

This makes sure that the script runs when the Advertising category is accepted and receives the correct signals.


For adsense tags we recommend loading them over CookieFirst, see below .


2. Load your Adsense or GPT scripts over the CookieFirst banner

You can also decide to move your tags from your website and run them over the cookiefirst platform.

1. Go to your domain in the cookiefirst administration panel. 

2. Click the "Scripts" button in the left menu.

3. Click the blue button "Add script" and search for Google Ads.

4. Select Load over banner

5. Copy the GPT.js or Adsense script and put in the code field. 

6. Click enable and save the script.


3. Use Autoblock

Without making modifications to your adsense or gpt scripts you can also use the autoblocking feature. Important: the banner embed should be placed directly after the <head> tag and run before any Google scripts

1. Go to the scripts tab in CookieFirst.

2. Click "Add script"

3. And search for the Google Ads tag. 

4. On the next screen select Integration Method Autoblock

5. Toggle to enable the autoblock and publish the script.

Articles in this section

Was this article helpful?
1 out of 1 found this helpful