Appearance
Dalton Pixel for Shopify
Add the Dalton Pixel to Shopify as a Custom Pixel so Dalton can track what happens in Shopify's checkout, including purchases.
Once it's installed, Dalton automatically tracks:
- Product added to cart (
add_to_cart) - Checkout started (
begin_checkout) - Checkout completed (
purchase)
1. Add the pixel
In your Shopify admin:
- Go to Settings → Customer events.
- Click Add custom pixel.
- Name it
Dalton Pixel. - Paste the following code into the Code editor:
javascript
// DALTON PIXEL — SHOPIFY CUSTOM PIXEL INSTALLATION
const customerId = {{customerId}} // Your Dalton customer ID
self.dalton = self.dalton || {}
self.dalton.analytics = analytics
self.dalton.browser = browser
self.dalton.init = init
const script = document.createElement("script")
script.setAttribute("id", "dalton-pixel")
script.src = `https://cdn.getdalton.com/pixel/${customerId}.min.js?customer_id=${customerId}`
document.head.appendChild(script)- Click Save.
If the code shows xxxxx instead of your customer ID, replace it with your Dalton customer ID before saving.
Replacing an older Dalton pixel?
If you already have a Dalton Custom Pixel, replace all of its code with the snippet above and save.
2. Connect the pixel
- In Settings → Customer events, open Custom pixels.
- Under Disconnected, find
Dalton Pixeland click Connect. - Review Shopify's confirmation and click Connect again.
The regular Dalton storefront script must also be installed so a Dalton session exists before checkout. See the Dalton Pixel Installation Guide for the storefront snippet. Do not add that storefront snippet inside the Custom Pixel editor.
Verify the installation
- Open the storefront in a new browser session.
- Add a product to the cart and begin checkout.
- Complete a test checkout if your store permits it.
- Confirm that the events appear in the Dalton dashboard with the correct page and session.
Settings → Customer events → Custom pixels should show Dalton Pixel as Connected.
Custom events
The events listed at the top of this page are tracked automatically. To track other actions, add these calls to your theme code (for example in a theme snippet or section) on pages where the Dalton storefront script is loaded. Don't add them to the Custom Pixel editor.
javascript
dalton?.fn?.purchased({ value: 49.95, currency: "EUR" })
dalton?.fn?.converted({ value: 10, currency: "EUR" })
dalton?.fn?.event("my_custom_event", { source: "shopify" })See Event Tracking Examples for more examples.
Disconnect or remove the pixel
- To pause tracking, go to Settings → Customer events → Custom pixels and click Disconnect next to
Dalton Pixel. - To remove it, click the menu button (≡) on the
Dalton Pixelrow, select Delete, and click Delete again to confirm.
Deleting a Custom Pixel is permanent.