
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:
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.
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.
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.