Skip to main content

Marqo Pixel – Shopify Custom Pixel Integration Guide (Pixel Sandbox)

This guide shows you how to install and test the Marqo Pixel directly using Shopify's Custom Pixel feature (a.k.a. Pixel Sandbox). This method ensures tight integration with Shopify's native analytics.subscribe() events, secure handling of customer data, and compatibility with privacy controls.


Quick Setup

Step 0: Open the Shopify Pixel Editor

  1. Go to your Shopify Admin → Settings → Customer Events
  2. Click Create Custom Pixel
  3. Name it "Marqo Pixel"
  4. Paste the provided Marqo Pixel script (template version) into the editor from marqo_shopify_pixel.js
  5. Click Save
  6. Don't publish yet — follow the next steps to customize and test before going live.

Step 1: Customize Your Pixel Config

In the script, fill in your Marqo account details and cookie names:

window.mq_config = {
customerId: '<FILL_IN_CUSTOMER_ID>',
experimentId: '<FILL_IN_EXPERIMENT_ID>',
apiKey: '<FILL_IN_API_KEY>',
siteUserIdCookie: '<FILL_IN_USER_ID_COOKIE>',
siteSessionIdCookie: '<FILL_IN_SESSION_ID_COOKIE>'
};
  • Customer ID / Experiment ID / API Key: Provided by your Marqo representative
  • Cookie Names: Used to extract persistent user/session IDs
  1. Visit your live storefront
  2. Open DevTools → Application → Cookies
  3. Look for cookies used for:
    • User identity (_shopify_y, bln-tid, etc.)
    • Session tracking (_shopify_s, auth_token, etc.)

These will be referenced in the pixel config.


Step 2: Understand Which Shopify Events Are Used

The Marqo Pixel automatically listens to the following Shopify Web Pixel events.

Shopify Event NamePixel Event LoggedDescription
search_submittedsearchUser submits a search query
product_viewedclickUser views or clicks a product
product_added_to_cartcartUser adds product to cart
checkout_completedpurchaseUser completes checkout/purchase

Step 3: Testing Your Pixel

  1. Enable Shopify Pixel Sandbox Mode: The Pixel Sandbox allows you to test pixel behavior without affecting production analytics. Make changes and test events in the Shopify admin before publishing live.

  2. Confirm Events Fire Properly: Perform each action on your storefront and ensure the corresponding pixel event triggers:

    ActionExpected Pixel EventWhat to Verify
    Submit a search querysearchPixel logs the search query data
    View/click a productclickPixel logs product ID, title, and referrer URL
    Add product to cartcartPixel logs product details and quantity
    Complete checkoutpurchasePixel logs purchase details for each line item

Step 4: Go Live

When testing is complete and you're confident the pixel fires correctly, publish the Custom Pixel in Shopify.

  • Monitor initial traffic and event logging for accuracy.

Troubleshooting

ProblemPossible CauseSolution
No events firingPixel script not saved or activeConfirm pixel saved and enabled in Shopify
Missing product dataShopify event data missing or renamedVerify Shopify event payload structure
Network requests failingAPI key or customer ID incorrectCheck config values in the pixel script
Cookies not foundCookie names incorrect or cookie blocked by browserVerify cookie names and browser settings

Support

For further assistance, please contact your Marqo representative.