Complete GDPR compliance and analytics for Shopify stores. Automatic e-commerce event tracking included.
Add code to theme.liquid and you're ready to go.
theme.liquid</head> tag</head><!-- CONSETO GDPR & Analytics -->
<script src="https://www.conseto.io/dist/conseto.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', async function() {
const conseto = await Conseto.init({
clientId: '{{ settings.conseto_client_id | default: "YOUR_CLIENT_ID" }}',
language: '{{ request.locale.iso_code | slice: 0, 2 | default: "en" }}',
theme: 'dark',
autoTrackEcommerce: true,
{% if settings.ga4_id %}
ga4: '{{ settings.ga4_id }}',
{% endif %}
{% if settings.gtm_id %}
gtm: '{{ settings.gtm_id }}',
{% endif %}
brandName: '{{ shop.name }}',
privacyPolicyUrl: '{{ pages.privacy-policy.url | default: "/pages/privacy-policy" }}',
cookiePolicyUrl: '{{ pages.cookie-policy.url | default: "/pages/cookie-policy" }}'
});
window.conseto = conseto;
});
</script>Add to config/settings_schema.json:
{
"name": "CONSETO",
"settings": [
{
"type": "text",
"id": "conseto_client_id",
"label": "CONSETO Client ID",
"info": "Get this from your CONSETO dashboard"
},
{
"type": "text",
"id": "ga4_id",
"label": "Google Analytics 4 ID",
"placeholder": "G-XXXXXXX"
},
{
"type": "text",
"id": "gtm_id",
"label": "Google Tag Manager ID",
"placeholder": "GTM-XXXXXX"
}
]
}CONSETO automatically tracks these Shopify events:
| Event | Shopify Page |
|---|---|
view_item | Product pages |
view_category | Collection pages |
add_to_cart | Cart additions |
begin_checkout | Checkout start |
purchase | Thank you page |
search | Search results |
For Shopify Plus stores, add to Checkout Settings → Additional Scripts:
{% if first_time_accessed %}
<script src="https://www.conseto.io/dist/conseto.min.js"></script>
<script>
(async function() {
const conseto = await Conseto.init({
clientId: 'YOUR_CLIENT_ID',
autoTrackEcommerce: false
});
conseto.trackConversion('purchase', {
transaction_id: '{{ order.name }}',
value: {{ total_price | money_without_currency | remove: ',' }},
currency: '{{ currency }}',
tax: {{ tax_price | money_without_currency | remove: ',' }},
shipping: {{ shipping_price | money_without_currency | remove: ',' }},
items: [
{% for line_item in line_items %}
{
item_id: '{{ line_item.product_id }}',
item_name: '{{ line_item.title | escape }}',
price: {{ line_item.price | money_without_currency | remove: ',' }},
quantity: {{ line_item.quantity }}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
});
})();
</script>
{% endif %}