Getting started
Required setupOptional setupTutorials and examples
Onboarding guidesTips and tricksP&L ReportTarget metricsMore information
Attribution modelsBayesian statisticsFrequently asked questionsMetrics overviewUser journey trackingProduct level metricsData Updates← How to enable tracking and consent
Add a Custom Pixel
- Open Shopify.
- Go to Settings → Customer Events.
- Click “Add custom pixel”.
- Name the Pixel “Admetrics Checkout Pixel”.
- Under Customer privacy:
- Set Permission to Required and select Analytics.
- Ensure Data Sale is set to “Data collected does not qualify as data sale”.
- 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 forshopId
. - Click “Save” and then “Connect”.
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;
}
});