How to install Google AdSense in compliance with GDPR

Attention: Pro Features
This type of Cookie is supported only in the Pro and Reseller versions of My Agile Privacy. Purchase your license and gain access to the entire database of pre-inserted cookies, constantly updated by the experts at My Agile Privacy.
>> Click here and find the plan that suits you best.

Google AdSense enables you to monetize your website traffic by displaying ads from Google’s advertising network.
These ads are personalized based on user interests, which means you must obtain explicit user consent before activating such scripts.

Learn how to install GDPR-compliant Google AdSense on your website using My Agile Privacy.

Solution 1 – Automatic Scan

Take advantage of the advanced "Cookie Shield" feature, which can automatically detect Google AdSense.
Set the Shield to "Learning" mode, browse your site’s pages, and the plugin will configure everything for you.
Alternatively, manual configuration is available.

Solution 2 – Manual Configuration

Part 1 – Your Google AdSense Code

After signing up for Google AdSense, you will receive a JavaScript code to insert on your site.
The code will look something like this:
Google AdSense code

Part 2 – Adding the Google AdSense Cookie in My Agile Privacy

In your WordPress admin area, go to My Agile Privacy → Cookie List from the left menu.
Here you’ll find a list of cookies imported during plugin installation, all initially set to draft.
Publish only the cookies relevant to your website.
cookie list
The cookie list includes columns such as:

  • Cookie Name: the name of the cookie.
  • Is Necessary: shows if the cookie is essential for your site to function properly. If rejecting the cookie breaks your site, it’s essential; this is pre-filled for each cookie.
  • Auto Update: indicates if the cookie reference text is updated automatically for GDPR compliance. If set to "yes," the plugin keeps everything up to date.
  • Installation Type: indicates the method to include the cookie. This varies depending on your setup and is explained in the guides.

To add the Google AdSense cookie, find the entry named "Google AdSense (Google Inc.)" and click on it.
On the detail page, you’ll find a pre-filled informational message and two blank fields for entering your code.
This message will appear in your cookie policy and will be kept up to date automatically if "Allow Automatic Update" is enabled.
Just below, select the "Type of Installation" (Javascript and Noscript, or Raw).
Pick "Raw Code" from the dropdown, and a field called "raw html code" will appear.

Part 3 – Entering Your Google AdSense Code

Simply copy your Google AdSense code and paste it directly into the "Raw Html Code" field.
entering the raw code
Don’t forget to save and publish the cookie by clicking the blue "Publish" button in the upper right corner.

Final Step – Verifying Proper Operation

To confirm that Google AdSense is working correctly, check the ads displayed through your Google AdSense control panel.
Ads will only be shown after the user has given explicit consent for the Google AdSense cookie.
Users can provide consent by clicking "I agree" on the cookie acceptance bar or by enabling the cookie under "Customize" in the My Agile Privacy cookie bar.

Beware of Penalties

For advertisers using the Adsense network, it is mandatory to use TCF 2.2 functionalities; otherwise, monetization will be suspended. Find out more here.

Download the free guide

Fill out the form and get immediate access to the guide in PDF format.
Mockup del pdf della guida
Loading in Progress...
Request successfully sent. You will be redirected to the download page shortly
By submitting this form I declare that I have read the privacy policy and authorize the Owner to respond to me for what is expressed in point a of the privacy policy
Warning: Your Cookie choices may not allow the form to be submitted.
Click here to review your preferences.
buy now My Agile Privacy - compliant in less than 3 minutes
a Formula Agile SRL project
COE / TAX ID 31366
Via Tre Settembre, 99 - 47891 Dogana - San Marino - RSM
Share capital 26'000€
For assistance: info[at]myagileprivacy.com
GDPR and privacy present complexities that extend beyond achieving website compliance. Compliance obligations span across all business aspects and necessitate expert analysis.
When it comes to implementing Banners and Policies, trust My Agile Privacy—the only solution that excludes unnecessary implementations not mandated by regulations.
Logo CMP partner GoogleLogo CMP partner GoogleLogo CMP partner GoogleLogo IAB Europe approvedLogo IAB Europe approved