Shopify Custom Pixel Integration

Embed the tracking pixel on your Shopify store using custom pixels

Shopify Custom Pixel Integration

This guide provides step-by-step instructions on how to embed the tracking pixel on your Shopify store using the custom pixel feature.

Step 1: Navigate to Customer Events

  1. Go to your Shopify admin panel
  2. Navigate to Settings > Customer Events

Step 2: Add Custom Pixel

  1. Click Add custom pixel
  2. Enter a name for your pixel (e.g., "Tracking Pixel")
  3. Click Add pixel

Step 3: Configure Privacy Settings

In the Customer Privacy settings, configure the appropriate consent settings based on your requirements and regional regulations.

Recommended settings:

  • Permission: Not required
  • Data sale: Data collected does not qualify as data sale

Loading the Pixel After User Consent

If your store requires user consent for tracking (for example under GDPR), set Permission to Required and select the Marketing and Analytics purposes. Shopify then loads the pixel only after the customer has given consent for these purposes.

Customers give consent in your store's cookie banner. Make sure the banner is enabled, or that your consent management platform (CMP) is connected to the Shopify Customer Privacy API.

Step 4: Add Pixel Code

Paste the following code into the editor:

window.dlApi = window.dlApi || { cmd: [] };
window.dlApi.shopifyAnalytics = analytics;
var script = document.createElement('script');
script.src = '{{PIXEL_SCRIPT_URL}}';
script.async = true;
document.head.appendChild(script);
ℹ️

Replace {{PIXEL_SCRIPT_URL}} with the actual script URL provided by your account manager.

Step 5: Save and Connect

  1. Click Save to save your pixel configuration
  2. Click Connect to activate the pixel on your store

Verification

After connecting the pixel:

  • Visit your store and perform test actions (view products, add to cart)
  • Check the pixel status in Customer Events settings
  • Verify events are being tracked in your analytics dashboard

Did this page help you?