Updating Consentmo for consent mode v2


To update your Consentmo setup, you'll need to remove the previously provide script from Consentmo and add in a new script.

First, let's determine how you have set your initial state

In Shopify Navigate to your Online store > Select Edit Code

In your theme code search for "consentmo", select the consentmoGDPR-gcm-blocking-scriptfile. Scroll through the file for search for "initialState": x as shown below. To keep the same settings you have now with the new setup you'll want to use this same value in the script you will add later.

In this example the initial state is 7. Remember your value.

Next, remove the previous script

In your Shopify theme code open your theme.liquid file.

Delete the line <script async src="{{ 'consentmoGDPR-gcm-blocking-script.js' | asset_url }}"></script> line from your theme.liquid

Next delete, the script file to clean up your theme.

Search for "Consentmo", click on the consentmoGDPR-gcm-blocking-script.js file and then click the Trash icon.

Delete the file

Next, add the new script into your theme

Download the new script

Download the new script: https://gdprstorage.b-cdn.net/faq/files/gcm-integration-script.zip

Create your snippet and update initial state

Create a new snippet in your theme named gcm-integration-script

Expand the snippet from the file navigation and select + Add a new snippet

Name your snippet gcm-integration-script

Paste the code into the new snippet & Save

Update your initial state if needed and Save


Understanding initial state

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 would like to adjust your default before consent values simply change the value in your gcm-integration-script snippet and save.

Reference your new snippet in your theme.liquid file

In you theme.liquid file add the follow line to our theme.liquid directly below the opening <head> tag.

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

It should look like this when complete, be sure to Save your updatees

Add the gcm-integration-script code to your thank you page

Copy the code from the snippet you just created in your theme and to your thank you page. If you have previously added script to your checkout settings for Consentmo, remove the previous scripts to replace with the new script.

  1. Copy the code from your snippet
  2. In Shopify navigate to Settings > Checkout > Scroll to Order Status Page
  3. Paste the code into the Additional scripts code block.
  4. Save your changes

You've now completed your conversion to consent mode v2 and are ready to confirm your setup!

Confirm your consent update values

Follow these steps to confirm the defaults have been set.

  1. Open your Google Tag Manager account and click to Preview your website
  2. Open the "Tag Assistant" tab, click on the first Consent event in the left column, the lowest number and lowest in the list.
  3. Click on the Consent Tab
  4. Review the values in the On-page Default column. You are looking to see values for all the consent types and specifically the updates for consent mode V2 you will see the addition of ad_user_data and ad_personalization

If you are seeing ad_personalization and ad_user_data like below your defaults are now updated for consent mode v2!

Confirm your consent update values

Next, we will confirm your consent update values if available. If your banner displays for your region, accept or deny your consent.

Now you'll want to select the most recent Consent event that was triggered by your update. You are looking to see that you now have values for all the consent types in the On-page Update column. Specifically the change for consent mode v2 is that you have values for ad_user_date and ad_personalization

If you are seeing ad_personalization and ad_user_data like below you are all set for consent mode v2!

Still have questions, concerns, or lack confidence in your updates? We've got you covered!

Reach out to our support team to have them review your updates.