Google Tag Manager setup
How to import the workspace included with the extension into Google Tag Manager and make your Google tags wait for the visitor's consent.
Why Google Tag Manager is needed
The popup stores the visitor's choice and announces it to Google Tag Manager with the event googleConsentUpdate. Google Tag Manager then tells your Google tags which consent types are granted. Without Google Tag Manager in your shop, the popup still appears, but the choice does not reach any tag, and your browser console shows Google Consent V2 error: Google tag manager tag not found.
Your Google Tag Manager container must already be installed in your shop, by your theme, another extension or code you added.
Download the workspace
- Open Google Consent V2 in your administration.
- Press Quick Tutorial, under Status. The SETUP TUTORIAL window opens.
- In Step 1, press the link to download the workspace. The file is
google_consent_v2_workspace.json.
Import it into Google Tag Manager
- In Google Tag Manager, open the container of your shop and go to Admin > Import Container.
- Choose the file
google_consent_v2_workspace.json. - Choose the workspace to import into, select Merge and keep your existing tags.
- Confirm the import.
The import adds these elements to your container:
| Type | Name | What it does |
|---|---|---|
| Tag | Cookies consent mode - Default settings | On every page, before any other tag, sets all consent types to denied. |
| Tag | Cookies consent mode - Accepted cookies | Updates the consent types with the visitor's choice, when the page loads for a visitor who already answered and each time a visitor answers. |
| Tag | Cookies consent mode - Settings applied | Runs right after the previous tag and sends the event that starts your other tags. |
| Trigger | Cookies not accepted and Cookies accepted | Consent initialisation triggers that check whether the visitor already answered the popup. |
| Trigger | Consent settings changed | Fires on the event googleConsentUpdate sent by the popup. |
| Trigger | Consent settings applied | Fires once the consent has been applied. Use it for your own tags. |
| Variables | Google Consent - Popup accepted and Google Consent - var followed by a consent type | Read the choices stored by the popup in the visitor's browser. |
| Template | Consent Mode (Google tags) | The tag template used by the two consent mode tags. |
Connect your tags
For every tag that depends on consent, such as Google Analytics 4, Google Ads conversions and remarketing, and the conversion linker:
- Open the tag in Google Tag Manager.
- In Triggering, remove its current page trigger (for example All Pages or Initialization - All Pages).
- Add the trigger Consent settings applied.
- Save the tag.
Tags that must fire on a specific event, such as a purchase, keep their own trigger. Google's consent mode then decides what they may store.
Publish
Press Submit in Google Tag Manager and publish the new version. The changes reach your shop as soon as the version is published.
Which consent types each category controls
| Category in the popup | Google consent types |
|---|---|
| Necessary | security_storage (always granted) |
| Preferences | functionality_storage, personalization_storage |
| Statistics | analytics_storage |
| Marketing | ad_storage, ad_user_data, ad_personalization |
Still need help?
Open a support ticket from your account and our team will look at your store with you.