Getting Started
Data Studio Overview
Understand your Reports
Understand your Metrics
Data Loading
Other
← How to enable tracking and consent
<aside> 💡 Written by Marina Koch, last updated on 21st of October 2024
</aside>
<aside> 🎓
What you will learn in this article:
Open Shopify.
Go to Settings → Customer Events.
Click “Add custom pixel”.
Name the Pixel “Admetrics Checkout Pixel”.
Under Customer privacy:
Paste the following code into the text box, and make sure to replace SHOP_ID_GOES_HERE
with the correct shop ID.
Retrieve your shop ID by clicking here, adjusting the domain to your shop, and searching for shopId
.
analytics.subscribe('all_events', (event) => {
switch (event.name) {
case 'checkout_started':
case 'checkout_completed':
case 'checkout_shipping_info_submitted':
case 'checkout_contact_info_submitted':
case 'checkout_address_info_submitted':
(function (w, d, s) {
var SID = 'SHOP_ID_GOES_HERE';
if (event.name !== 'checkout_completed') {
w.admDataLayer = w.admDataLayer || [];
w.admDataLayer.push({ name: event.name });
}
var f=d.getElementsByTagName(s)[0],
l=d.createElement(s),j=d.createElement(s);
f=f.parentNode?f:d.getElementsByTagName("head")[0];
_r('js-app-admq-script');
j.id = 'js-app-admq-script';
j.async = true;
j.src = '<https://shopify.admetrics.events/conversion-v1.min.js>';
_r('js-app-admq-data');
var cod = (event.data && event.data.checkout &&
event.data.checkout.order)||{},
coi=cod.id||"",cci=cod.customer?cod.customer.id||"":"";
l.id = 'js-app-admq-data';
(l.type = 'application/json'),
(l.textContent = JSON.stringify({
sid: SID,
oid: coi,
cid: cci,
}));
_a(l) && _a(j);
function _r(e){
var n=d.getElementById(e);
return n&&n.parentNode.removeChild(n)}
function _a(e){
return f.parentNode?f.parentNode.insertBefore(e,f):
f.appendChild(e);}
})(window, document, 'script');
break;
default:
return;
}
});
Click “Save” and then “Connect”.