Articles on: Frequently Asked Questions (FAQ)

Google Consent Mode V2 Integration

In order to implement the new Google Consent Mode V2 integration for the Consentmo GDPR Compliance app, follow these steps:

For NEW USERS that do not have any integration from Consentmo with Google Consent Mode V2 set already, the process is the following:



Open Shopify Admin.
Click on Online Store link in the left menubar.
Click on the Actions dropdown button and select Edit Code from there.
A new page will open with a list of files on the left side of the screen. Open the theme.liquid file.
Locate the opening <head> and right after it, add the following line of code:

{% render 'gcm-integration-script' %}


Note: The line of code should be placed right after the opening <head> tag as the Google Consent Mode needs to be executed before the other tracking services (Google Tag Manager, Google Ads, etc.).

Create a new liquid file in the Snippets section of the theme files, called gcm-integration-script

After that copy the content of the integration script provided below and paste it in the newly created Snippet file:

Download Google Consent Mode V2 Integration script

The final result should look like this:




For EXISTING USERS that have the previous integration from Consentmo with Google Consent Mode already, the process is the following:



Open Shopify Admin.
Click on Online Store link in the left menubar.
Click on the Actions dropdown button and select Edit Code from there.
A new page will open with a list of files on the left side of the screen. Open the theme.liquid file.
From there, remove the old line loading the integration script which is:
<script async src="{{ 'consentmoGDPR-gcm-blocking-script.js' | asset_url }}"></script>
From the Assets section, locate the JS file consentmoGDPR-gcm-blocking-script.js , and delete it as well.

Reference on the lines and files that needs to be deleted, can be checked below:



Once the above steps are done, you can proceed with the integration of the new script following the steps at the beginning of this article.


Once this is done, the integration of the Google Consent Mode with our app will be successfully set in your store.


For further information on how our app works with Google Consent Mode, continue reading the text below:

Google Consent mode has two variants.



Before consent:
These are the default settings that the page will use while waiting for the user’s consent status to be given.
When your customers visit your store, the integration we provided will initially run the default settings and populate the parameters in the dataLayer to granted or denied depending on how the option Initial State Of The Cookie Bar is set.

By default, the integration script we provide is set to block all categories and all the parameters will be set to denied. If you want to change this as per your preferences please refer to the information on the different initial states in the script file, as shown here:



After consent:
Then, there are the update settings that are sent as soon as consent has been given.
After that, when your store visitor gives his consent by accepting the Cookie bar, the updated settings will set the parameters to granted or denied depending on which cookie categories the visitor chooses to block. If no cookie categories are blocked, the Google services will set their cookies to the visitor's browser.


As a general recommendation, it would be best to check and address the steps for overall store compliance, listed in the below article as well:
* Setting your store's compliance


In order to test the integration once you complete the above steps, please refer to the guide we have for this in the below article:



Testing the integration with Google Consent Mode V2

In need of any assistance with the setup, do not hesitate to drop us a line at support@consentmo.com or via our Live chat.

Updated on: 12/06/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!