How to block Klaviyo from collecting information?
How the script works?
We are setting the Klaviyo cookie __kla_off to true, which should stop Klaviyo from tracking onsite activity data, if the customer has opted out of the Marketing cookie group through our app.
For additional reference on how the script works, feel free to check the documentation for Klaviyo here - About Cookies in Klaviyo
In order to block the tracking from Klaviyo so that no information is being collected if a customer has opted out of the Marketing cookie group, you would need to add an additional script in your main theme file. Here are the steps that you would need to follow:
Open Shopify Admin.
Click on Online Store link in the left menubar.
Click on the Action 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.
Find the closing </head> tag there.
When you do, you can copy and add the following snippet before the closing </head> tag:
Click on the "Save" button.
NOTE: Make sure to remove the added code before deleting the app. This way, no snippets of code will be left in your theme. For more information on what you should be aware of when deleting our app check this article of our FAQ page.
Once you’ve successfully added the script, you need to add the Klaviyo cookie __kla_id into our app by navigating to Cookie bar settings tab > Management section.
You can add the cookie from the Cookies management table, as shown below:
The __kla_id cookie can be added with the following details:
Cookie provider - Klaviyo
Cookie description - This cookie is used to collect information about the visitor's behaviour. This information will be stored on the website for internal use.
Category - Marketing
Duration - 2 years
If you have any questions, don't hesitate to contact our support team at: support@consentmo.com or from the Chat button at the bottom right corner of your browser.
We are setting the Klaviyo cookie __kla_off to true, which should stop Klaviyo from tracking onsite activity data, if the customer has opted out of the Marketing cookie group through our app.
For additional reference on how the script works, feel free to check the documentation for Klaviyo here - About Cookies in Klaviyo
In order to block the tracking from Klaviyo so that no information is being collected if a customer has opted out of the Marketing cookie group, you would need to add an additional script in your main theme file. Here are the steps that you would need to follow:
Open Shopify Admin.
Click on Online Store link in the left menubar.
Click on the Action 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.
Find the closing </head> tag there.
When you do, you can copy and add the following snippet before the closing </head> tag:
<!-- Klaviyo integration script from Consentmo GDPR app -->
<script id="consentmo-klaviyo-integration-script">
function checkConsentForKlaviyo(isMarketingEnabled) {
if (isMarketingEnabled) {
document.cookie = "__kla_off=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
} else {
document.cookie = "__kla_off=true";
}
}
document.addEventListener('consentmoSignal', function(eventData) {
const consentPreferences = eventData.detail.preferences;
checkConsentForKlaviyo(consentPreferences.marketing);
});
</script>
Click on the "Save" button.
NOTE: Make sure to remove the added code before deleting the app. This way, no snippets of code will be left in your theme. For more information on what you should be aware of when deleting our app check this article of our FAQ page.
Adding the Klaviyo cookie
Once you’ve successfully added the script, you need to add the Klaviyo cookie __kla_id into our app by navigating to Cookie bar settings tab > Management section.
You can add the cookie from the Cookies management table, as shown below:
The __kla_id cookie can be added with the following details:
Cookie provider - Klaviyo
Cookie description - This cookie is used to collect information about the visitor's behaviour. This information will be stored on the website for internal use.
Category - Marketing
Duration - 2 years
If you have any questions, don't hesitate to contact our support team at: support@consentmo.com or from the Chat button at the bottom right corner of your browser.
Updated on: 28/11/2024
Thank you!