Skip to main content

Integrate Axeptio with the Shopify app

Written by Alexandre Dias Da Silva

You have 2 options for integrating Axeptio on your Shopify store.

With these installations, you can configure:

  • Your Axeptio project

  • Google's Consent Mode V2

  • Interaction with Shopify's consent API

Option 1 - via the Shopify app (Recommended)

Axeptio offers a Shopify application that will make your life easier.

The application installation is done in several steps:

  1. Connection to your Axeptio account, you must log in with your username/password

  2. Creation of a project or connection to an existing project (Important step)

  3. Activation of the embed app in Shopify which allows you to display our widget on the site

You are then on the control screen to customize the colors and information of your widget.

Google Consent Mode V2 Configuration

The Axeptio plugin is compatible with Google's Consent Mode V2. To activate consent mode V2, follow these steps:

  1. In the Axeptio back office, enable Consent Mode V2 to display Google's 4 consent purposes. You can customize the display. Publish the widget.

  2. In your Shopify back office, enable the Consent Mode V2 option and the default values you wish to set.

The checkboxes allow you to set the default values of Consent Mode v2 to "Granted" (checked) or "Denied" (unchecked). For sites intended for Europe, we recommend leaving them on "Denied" (unchecked).

Option 2 - Via a hard-coded integration in your Shopify liquid template with the code provided by Axeptio in the "Integration on my site" section

Recommended if you have a specific need in the Axeptio integration.

The code to retrieve from Axeptio

<script type="text/javascript">
window.axeptioSettings = {
clientId: "v##{{Your Client ID to Modify}}",
};

(function(d, s) {
var t = d.getElementsByTagName(s)[0], e = d.createElement(s);
e.async = true; e.src = "//static.axept.io/sdk.js";
t.parentNode.insertBefore(e, t);
})(document, "script");
</script>

1 - Add the specific Shopify code

If your store is in French:

<script>
window.vendors_shopify = [
{
name: "shopify_preferences",
title: "Preferences",
shortDescription:
"Cookies that remember your preferences, such as country or language, to personalize your visits to our website",
policyUrl: "https://www.shopify.com/legal/terms",
domain: "shopify.com",
},
{
name: "shopify_analytics",
title: "Analytics",
shortDescription:
"Cookies to understand how you interact with our site",
policyUrl: "https://www.shopify.com/legal/terms",
domain: "shopify.com",
},
{
name: "shopify_marketing",
title: "Marketing",
shortDescription:
"Cookies to provide advertisements and marketing communications based on your interests",
policyUrl: "https://www.shopify.com/legal/terms",
domain: "shopify.com",
},
{
name: "shopify_sale_of_data",
title: "Sale of data",
shortDescription:
"Opt in / out of data sharing / sale",
policyUrl: "https://www.shopify.com/legal/terms",
domain: "shopify.com",
},
];

(_axcb = window._axcb || []).push(function (sdk) {
sdk.on("ready", function () {

if (!sdk.cookiesConfig) {
return;
}

// Building the Shopify step in the cookie widget
sdk.cookiesConfig.steps.splice(1, 0, {
hasVendors: true,
image: "cookie-bienvenue",
layout: "category",
message:
"Shopify uses several services and plugins, we can control them via their privacy API",
name: "welcome",
onlyOnce: true,
title: "Shopify Cookies",
subTitle: "Shopify uses several services, does this suit you?",
vendors: window.vendors_shopify,
});

// Shopify consent API
window.Shopify.loadFeatures([
{
name: "consent-tracking-api",
version: "0.1",
},
]);
});

// Update of the Shopify consent API
sdk.on("consent:saved", function (payload) {
const choices = payload.consent.preferences.vendors;
window.Shopify.customerPrivacy.setTrackingConsent(
{
preferences: choices.shopify_preferences,
analytics: choices.shopify_analytics,
marketing: choices.shopify_marketing,
sale_of_data: choices.shopify_sale_of_data,
},
() => {}
);
});
});
</script>

2 - Log in to your Shopify admin.

  • In the left menu, go to Online Store > Themes.

  • Click on the action menu and select "Edit code".

Intégration-Shopify-axeptio-Developer-Hub.png

  • Copy the 2 code blocks just before the </body> tag in this file.

  • At the top right, click Save.

3. Enable Consent Request on the Shopify side

Go to the "Preferences" section, then follow the steps in the video below.

Once this is done, consent will be necessary before any data collection by your Shopify applications, for all selected countries.

Did this answer your question?