Skip to main content
All CollectionsGoogle consent mode v2
Set up Google consent mode v2 using WordPress plugin
Set up Google consent mode v2 using WordPress plugin

Learn how to set up the Cookie Information WordPress plugin for Google consent mode v2.

Updated over a month ago

In this article, we’ll walk you through setting up the Cookie Information WordPress plugin for Google consent mode v2.

Before you start

Here are a few things to know before you start:

  • This guide shows you how to install the Cookie Information WordPress plugin and use it for setting up Google consent mode v2. This instruction applies to setting up the WordPress plugin with the advanced Google consent mode v2. To implement the basic mode, see our Google consent mode v2 guide.

  • This guide also covers instructions on how to configure and update the Cookie Information WordPress plugin. Regular updates are crucial for maintaining the security and functionality of your WordPress plugins.

  • Google consent mode v2 processes the consent preferences of your users obtained through your consent popup. It adjusts the functioning of analytics, ads, and third-party tags responsible for creating or accessing cookies based on these preferences.

    There are two different modes available in this version: basic and advanced. You can implement both in Cookie Information. The basic consent mode doesn’t allow you to collect any user data, not even consent status, until the user agrees. In the advanced consent mode, Google tags are loaded before the consent popup displays to users. Google collects cookieless data without personal identifiers.

  • If your site is set up with a single default language, our plugin will automatically detect it. If you need more than one language, apart from setting it up in Cookie Information, you’ll need to set up an additional plugin, for example, the WPML plugin. You can find instructions on the plugin's official page.

  • To learn how to customize your cookie consent template, see this style guide.

Set up the WordPress plugin

To set up the Cookie Information WordPress plugin, follow these steps:

1. Log in to your WordPress account.

2. In your Dashboard, navigate to Plugins.

3. Click Add New Plugin.

4. Type ‘Cookie Information’ in the search bar.

search for Cookie Information WordPress plugin

5. Click Install Now.

Note: You can also find the Cookie Information plugin for WordPress here.

install cookie information plugin in wordpress

6. Click Activate.

activate Cookie Information plugin in WordPress

Note: There’s another way to activate the plugin.

Go to Installed Plugins, find Cookie Information in the list, and click Activate.

activate Cookie Information plugin in WordPress

7. In Dashboard Settings, go to Cookie Information.

8. Turn on the consent popup.

9. Turn on Google Consent Mode v2.

10. (Optional) Turn on IAB TCF v2.

Note: If turned on, we’ll collect and send consent information to your vendors so that they can display personalized ads to users. You must use a dedicated template: IAB TCF v2.2. + Google Consent Mode v2. For more information, see this article.

11. Add cookie policy by copying and pasting the shortcode:

Add a privacy policy short code

12. Add privacy controls by copying and pasting the shortcode:

13. (Optional) Turn on video auto-blocking and choose the cookie category you want to use to block videos.

Turn on video auto-blocking and choose the cookie category you want to use to block videos.

14. (Optional) In Placeholder text type the text that will appear in place of the blocked video.

Setting up the placeholder text that will appear in place of the blocked video video.

15. Click Save changes.

16. Log in to Cookie Information.

17. Go to Consent solutions.

18. Find the consent solution where you want to change the consent popup template.

Choose consent solution in Cookie Information

19. Navigate to Pop-up appearance and click the Template drop-down list under Change template.

20. Choose Overlay v2 - Google consent mode v2 and Overlay v3 - Google consent mode v2.

Choose Overlay v2 - Google consent mode in Cookie Information

The default versions of overlay v2 and v3 without any customization look like this:

Cookie consent banner templates in Cookie Information

View our template showcase to see all template designs. To learn how to customize your template, see this style guide.

Note: Changing your template will reset any customizations including text or styling, you have made earlier.

21. (Optional) If you use a different cookie consent template or create a custom one, you need to add a link to Google’s business data responsibility site to meet Google’s requirements.

In Pop-up appearance, go to Advanced options. Add the following code to your template’s HTML code:

​<a class="coi-banner__google-privacy-policy" aria-label="{{{translations.google_privacy_policy_link}}}" href="https://business.safety.google/privacy/" target="_blank">{{{translations.google_privacy_policy_link}}}</a>

Advanced options of cookie consent template in Cookie Information

22. Make sure that the main installation code in the source code of your website contains data-gcm-version attribute with the value set to "2.0". We recommend placing the code in the <head> tag to ensure that the script is loaded first and the cookies can be blocked before consent has been given.

The main installation code will look like this:

<script id="CookieConsent" type="text/javascript" data-culture="EN" src="https://policy.app.cookieinformation.com/uc.js" data-gcm-version="2.0"></script>

Note: The attribute data-culture = "EN" controls the language in which the popup will appear on the page – in this example, it will be displayed in English. To change the language, set the data-culture attribute to a different language code. For more details, see this article.

Update the Cookie Information WordPress plugin

To update the Cookie Information WordPress plugin, follow these steps:

1. Go to your WordPress Dashboard.

2. Navigate to Installed Plugins.

3. Go to Cookie Information plugin, where you will see a notification about the latest update available.

4. Click View version details to see the plugin’s changelog with the changes this release will bring.

Cookie nformation Consent solution WordPress plugin changelog

5. Click Update Now.

Note: WordPress will automatically download and install the update. During this process, the plugin might be temporarily deactivated and then reactivated.

6. All done! Your plugin is now updated.

Related articles

Did this answer your question?