Set Up a Cookie Banner and Google Consent Mode on WordPress

Privacy rules are tightening in India and abroad. A proper consent banner protects the business and keeps Google’s measurement working.

30–60 minutes

Verified by Hassan Rawther ·

Hassan Rawther is the Founder, Unlearn Academy. Written by the Unlearn Academy team.

0 of 5 doneContinue →

The short answer

To set up Consent Mode on WordPress, install a Google-certified consent banner plugin (such as CookieYes, Complianz or Cookiebot), turn on its Google Consent Mode v2 option, and make sure it loads before your Google tags. In GTM, check each tag’s consent settings. Then test in Tag Assistant: before consent, ad_storage and analytics_storage should be denied; after Accept, granted.

Before you start

By the end of this SOP

Visitors see a clear consent banner, Google tags respect their choice, and Tag Assistant shows the correct consent states.

Time
30–60 minutes
You’ll need
WordPress admin access and GTM or the Google tag on the site (SOP 004).
Who does this
The person managing the website and tracking; the business owner decides the policy wording.
About this SOP: why it matters, where and when

Why it matters: India’s Digital Personal Data Protection (DPDP) Act requires clear consent for personal data, and Google requires Consent Mode for ads personalisation in the EEA and UK.

Where: WordPress plugins, the consent plugin’s settings, GTM and Tag Assistant.

When: Before running remarketing or collecting personal data through forms, and when serving visitors from the EU or UK.

Stage 1

Choose and install a consent plugin

  1. 1

    Pick a Google-certified consent management platform (CMP) with a WordPress plugin, for example CookieYes, Complianz or Cookiebot.

  2. 2

    Install and activate it, then run its setup wizard. Choose the regions you serve and the banner style.

  3. 3

    Write the banner text in plain words: what you collect, why, and how to change the choice later. Link your privacy policy.

Stage 2

Turn on Consent Mode v2

  1. 1

    In the plugin settings, enable Google Consent Mode (v2).

  2. 2

    Set the default state. For EEA and UK visitors, default to denied until consent. For India, many businesses also default to denied for ads cookies to follow DPDP principles.

  3. 3

    Make sure the plugin’s consent default loads before GTM or the Google tag. Most plugins handle this; if you use GTM, use the plugin’s GTM template or the Consent Initialization trigger.

    Note

    Basic mode blocks Google tags until consent. Advanced mode loads them in a cookieless way and sends modelled data. Advanced keeps more measurement but needs clear disclosure.

Stage 3

Check tag consent settings in GTM

  1. 1

    In GTM, open Admin → Container settings and tick “Enable consent overview”. Then open Tags → the shield icon to see consent per tag.

  2. 2

    Google tags (GA4, Google Ads) have built-in consent checks. For Meta, LinkedIn or other non-Google tags, set “Require additional consent” for ad_storage.

  3. 3

    Publish the container after changes.

Stage 4

Test it

  1. 1

    Open tagassistant.google.com, connect your site, and open the Consent tab on the first event.

  2. 2

    Before clicking the banner: ad_storage, analytics_storage, ad_user_data and ad_personalization should be denied (if that’s your default).

  3. 3

    Click Accept and check they change to granted. Repeat in a fresh browser and click Reject: Meta and other non-Google tags should not fire.

  4. 4

    Check that visitors can reopen the settings later (a small floating icon or footer link).

Practice & check

Now do it for real

Reading is not doing. Open your own account and complete this task before you move on.

Practice task (5 min)

On a test WordPress site, set up a consent plugin with Consent Mode v2 and screenshot Tag Assistant’s Consent tab before and after clicking Accept.

Prove it

1. Which two signals were added in Consent Mode v2?
2. What should happen to a Meta Pixel tag when a visitor clicks Reject?

Two questions. Get both right and this SOP is done.

Common questions

Is a cookie banner required in India?

India’s DPDP Act requires clear, informed consent for processing personal data, and rules are being phased in. A consent banner is the practical way to collect and record it for tracking. Get legal advice on the exact wording.

Will Consent Mode reduce my conversions?

Reported conversions may drop when people decline. In Advanced mode, Google models some of the missing conversions. Accurate consent is still better than unlawful tracking.

Do I need Consent Mode if I don’t target Europe?

Google requires it for ads personalisation in the EEA and UK. Elsewhere it’s strongly recommended, and it supports compliance with local privacy laws like DPDP.

Done. That’s a real skill, not a certificate.

Next: SOP 313 — See Campaign and UTM Results in GA4 →

Want to do this on real client budgets, with a mentor checking your work? That’s Level 2 at Unlearn. See the Digital Marketing track