What is Google Consent mode?
Google Consent mode interacts with your cookie banner to communicate your customers’ cookie preferences to Google. Google will then adjust which cookies are enabled and what can be tracked based on your customers’ privacy choices.
Where is Google Consent legally required?
Google Consent mode is required in all countries that are located or serve customers in the European Economic Area (EEA) and in Quebec, Canada. Consent mode does not replace GDPR and CCPA guidelines, it only adds another layer of consent for Google products (Analytics, Ads, etc).
How does this affect my eCom (C-Series) cookies and Google Analytics settings?
To ensure eCom (C-Series) is fully compliant with Google Consent mode in EEA and Quebec, Canada, Lightspeed has set the analytics_storage parameters for cookies to ‘denied’ by default.
This ensures that customers must agree to cookies before any tracking data is sent to Google, regardless of which Cookie law option you have set in your store. Once a customer has given consent, tracking data will flow uninterrupted to Google.
In light of this change, you may need to update some of your cookie law and Google Analytics settings to continue collecting data.
What updates do I need to make to my cookie law settings in eCom?
What cookie law settings you have set in your store affects what data Google will track. Your customer needs to give explicit consent before Google can track and store data, meaning you must have a cookie law option that requires the customer to give consent.
Google Consent is given via the Lightspeed cookie bar, which is only tied to the Measurement ID provided in Settings > Web Statistics > Google Analytics 4. If you have custom tracking, code updates are also required.
To update your cookie law settings, navigate to Settings > Web extras.
In the Cookie law section, you have four options to choose from:
-
Recommended
Show a custom message on the first page: This option allows you to write a custom cookie notification message and include links to your privacy and cookie policies. This option requires customers to allow cookies before tracking data is sent to Google. - Confirmation is required for cookies: In the EEA and Quebec, Canada, this option requires your customer to consent to cookies before tracking data is sent to Google.
- Just show warning and enable cookies: This option tells customers that your site uses cookies but does not allow them to give consent. This option is not compliant with Google Consent mode, GDPR, and CCPA guidelines.
- Disabled: This option disables the cookie bar. In the EEA and Quebec, Canada, because consent is required before data can be collected, Google Consent will override this option and will not send any tracking data to Google.
It’s recommended to update your privacy and cookie policy to allow your customers to make informed decisions about their cookie consent. As part of your cookie banner or privacy policy, you can add the following link to let customers change their preferences at any time:
<a href="/cookielaw/manage/">Manage cookies</a>
I use custom tracking, what updates do I need to make to my Google Analytics (GA4) settings?
If you’ve added custom Google Tag Manager tracking scripts through the eCom Theme editor, you may need to revise this code to avoid conflicts with the new cookie law parameters and prevent a drop in GA4 data. If you do not have custom tracking scripts, you do not have to update your code.
Lightspeed does not support theme customizations and cannot provide assistance with this.
Updating custom tracking scripts in the theme editor
- From the main menu, navigate to Design.
- In your live theme, click Advanced.
- Click Edit code.
- Wrap the custom Google Tag Manager code with Lightspeed cookie bar values using the following code:
{% if shop.cookies.allow == 'true' %} // OWN Google Tag Manager CODE {% endif %}
The value can be replaced with other parameters like analytics, ads, or socials to suit your needs. For example:
{% if shop.cookies.analytics == 'true' %} (or a combination check with && or and)
- Click Save.
If you work with a theme partner, they will also need to update these scripts.
Updating custom tracking scripts in Web Extras
- From the main menu, navigate to Settings > Web Extras.
- If you’re using custom scripts, they will be located in Custom JS or Custom head code.
- Wrap the custom Google Tag Manager code with Lightspeed Cookiebar values using the following code:
window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} const getCookieValue = (name) => ( document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')?.pop() || '' ); const cookieLawAds = parseInt(getCookieValue('COOKIELAW_ADS')) ? 'granted' : 'denied'; const cookieLawStats = parseInt(getCookieValue('COOKIELAW_STATS')) ? 'granted' : 'denied'; gtag('consent', 'default', { 'ad_storage': cookieLawAds, 'ad_user_data': cookieLawAds, 'ad_personalization': cookieLawAds, 'analytics_storage': cookieLawStats, }); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-XXXXXXX');
- Click Save.
If you work with a theme partner, they will also need to update these scripts.