> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/integrations/shopify-to-google-analytics/using-google-consent-modev2.md).

# Using Google Consent Mode v2 with Shopify

This article explains how Littledata integrates with Google's Consent mode v2.

## What is Google Consent Mode v2?

Google Consent Mode v2 is the latest version of Google Consent mode, that allows web and app developers to limit data collection on user consent choices.

From March 2024, all advertisers wanting to run personalized Google Ads to users in Europe [must use Consent Mode v2](https://support.google.com/google-ads/answer/14505993?hl=en).

You can read more about [Consent Mode on Google](https://support.google.com/google-ads/answer/10000067?hl=en-GB).

## How does Littledata work with Google Consent Mode?

Littledata integrates automatically and seamlessly with Consent Mode v2 via Shopify Customer Privacy API. This includes Advanced Consent Mode, sending cookieless pings to Google servers even if the user does not accept consent, so Google can [better model and predict](https://support.google.com/analytics/answer/11161109?sjid=13651967392339077290-EU) your non-consenting traffic.

There is one switch to flip first: **Consent mode** must be enabled on your Google Analytics connection. It is off by default on new connections, and everything else is handled for you once it is on.

{% hint style="warning" %}
**Turn on Consent mode first**

While **Consent mode** is off, Littledata sends no consent default or update commands to Google and tracks every shopper as if consent had been granted, no matter what your cookie banner shows.

[Enable Consent mode](#enabling-consent-mode) on your Google Analytics connection before relying on any of the behaviour described below.
{% endhint %}

Most [Shopify cookie banners](/partner-recipes/cookie-consent-integrations/shopify-customer-consent-api.md) and some Consent Management Platforms (CMPs) support this Customer Privacy API.

{% hint style="info" %}
For Consent Mode to work you must have a cookie banner. You can set it up from your Shopify Admin by going to **Settings -> Customer Privacy -> Cookie Banner**, or use another banner app that is compliant with Shopify Customer Privacy API.
{% endhint %}

## Enabling Consent mode

1. In the Littledata dashboard, go to **Connections**
2. Select your **Google Analytics** destination
3. Open the **General** tab
4. Enable **Consent mode**, tick **I understand** in the confirmation modal, and save

There is a single Consent mode setting per destination — there is no separate, GA4-only Consent Mode v2 toggle. See [data pipeline settings](/advanced/developer/data-pipeline-settings.md) for the other settings on this tab.

{% hint style="info" %}
**Shopify Markets**

If the [Shopify Markets](/sources/shopify-markets/markets-settings.md) module is enabled, destination settings are held **per market**, and that includes Consent mode. Enabling it for one market does not enable it for the others, and a market that is deleted and re-created in Shopify comes back with factory settings. Check the setting in every market you sell into.
{% endhint %}

### Which connection controls the Google tag

Google Analytics and Google Ads share the same Google tag on your store, so only one connection sets its consent state:

* If you have a **Google Analytics** connection, its Consent mode setting controls the whole consent state — including the advertising parameters `ad_storage`, `ad_user_data` and `ad_personalization`. Turning Consent mode on for Google Ads while GA4 is connected has no effect on the tag.
* If you have **no Google Analytics connection**, your Google Ads connection takes over and its own Consent mode setting applies.

## Mapping of Shopify consent types to Google

Shopify’s Customer Privacy API supports four consent types.Google Consent Mode v2 tracks customer consent as four different properties, which switch their state depending on the preferences that the customer has chosen within the [Shopify cookie banner](/advanced/troubleshooting/consent-banner-design-ga4.md) or CMP:

| **Google Consent Mode Parameter** | **Shopify Consent Type** |
| --------------------------------- | ------------------------ |
| `ad_storage` = `granted`          | `marketing` = `yes`      |
| `ad_user_data` = `granted`        | `marketing` = `yes`      |
| `ad_personalization` = `granted`  | `marketing` = `yes`      |
| `analytics_storage` = `granted`   | `analytics` = `yes`      |

The first 3 parameters (those that pertain to advertising) will change their status when marketing consent is accepted or denied, while the last parameter will change based on analytics consent.

Depending on what the user has accepted or declined, a consent update could look like this:

![Consent Mode parameters](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-1c283486d6df6c5fbc721795eca85bd67992cfcb%2Fconsetnss.png?alt=media)

[Consent Mode v2](/advanced/developer/how-to-check-whether-google-consent-mode-v2-is-properly-working.md) adds 2 new parameters to the consent states, those being:`ad_user_data` and `ad_personalization`.

## Advanced Consent Mode and Modeling

Unlike Basic Consent Mode, which only allows data collection from users who explicitly grant consent, the Advanced Mode collects data from users who do not grant explicit consent, thus enabling a more comprehensive data collection process. To go more in-depth here's an article on [how to check if a website implements Google Consent Mode V2 properly](/advanced/developer/how-to-check-whether-google-consent-mode-v2-is-properly-working.md).

![Basic consent mode vs advanced consent mode](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-91254a9299f4a147a21fbeaf8aa3ddefecdc4cc5%2Fconsent.png?alt=media)

When consent is denied, the Google Analytics library will still load and send events, but these will be sent as cookieless pings. This allows Google to collect and model data without relying on cookies, ensuring compliance with user consent choices while still enabling valuable insights through advanced data modeling.

This modeling includes Google Ads consent mode modeling, Google Ads online modeling, Google Analytics conversion modeling, and Google Analytics behavioral modeling.

![Modeled data in GA and Google Ads](https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-80691501ea6732b058b2c4b50416367e9dd7f975%2Fscreenshot-2024-03-15-at-15.18.03.png?alt=media)

With Advanced Consent Mode store owners can rest assured that their tracking efforts are in line with privacy standards while still being able to obtain valuable information about their users. This is a significant step forward in data tracking and privacy.
