This custom pixel allows you to integrate Eulerian Marketing Platform tracking with your Shopify store using the Web Pixels API.
- Page View Tracking: Track general page views (excluding product, cart, and checkout pages)
- Product View Tracking: Track when customers view product pages
- Add to Cart Tracking: Track when customers add products to their cart
- Purchase Tracking: Track completed purchases with order details and line items
- Smart Context Detection: Prevents duplicate tracking calls by detecting page context
- Debug Mode: Built-in logging for easy testing and troubleshooting
- Shopify store with access to admin settings
- Eulerian Marketing Platform account with your tracking subdomain -> Create a free account !
- Basic understanding of Shopify admin interface
Before installing, you need to update the configuration with your tracking domain:
const CONFIG = {
scriptSrc: "https://YOUR-TRACKING-DOMAIN/ea.js", // Replace with your domain
debug: true // Keep true for testing, set to false for production
};YOUR-TRACKING-DOMAIN with your actual Eulerian tracking domain.
-
Access Shopify Admin
- Log into your Shopify admin panel
- Navigate to Settings → Customer events
-
Add Custom Pixel
- Click Custom Pixels
- Click Add pixel
-
Configure Pixel Details
- Pixel name: Enter a descriptive name (e.g., "Eulerian Marketing Platform")
- Code: Copy the complete JavaScript code from snippet/generic.js in this repository
- Make sure you've updated the
scriptSrcwith your domain
-
Save and Connect
- Click Save
- Click Connect to activate the pixel
With debug: true, the pixel will log all tracking activities to the browser console:
-
Open Browser Developer Tools
- Press
F12or right-click → Inspect - Go to the Console tab
- Press
-
Expected Log Messages
🚀 Tracking script loaded successfully 📊 Subscribed to page_viewed 📊 Subscribed to product_added_to_cart 📊 Subscribed to checkout_completed 📊 Subscribed to product_viewed ✅ Page view tracked ✅ Product view tracked ✅ Add to cart tracked ✅ Checkout completed tracked
Test each tracking scenario:
-
Generic Pages: Visit homepage, about page, contact page
- Should see:
✅ Page view tracked
- Should see:
-
Product Pages: Visit any product page
- Should see:
✅ Product view tracked - Should NOT see page view tracking
- Should see:
-
Add to Cart: Add a product to cart
- Should see:
✅ Add to cart tracked
- Should see:
-
Complete Purchase: Make a test purchase
- Should see:
✅ Checkout completed tracked
- Should see:
Check that data is being sent to Eulerian Marketing Platform:
- Network Tab: Monitor network requests in developer tools
- Look for requests to your tracking domain
- Verify parameters are being sent correctly
| Issue | Solution |
|---|---|
| No console logs appearing | Check that debug: true in CONFIG |
| Script not loading | Verify your scriptSrc URL is correct |
| Events not firing | Check Shopify's Customer Events are enabled |
| Missing data | Verify the event data structure matches expectations |
| Message | Meaning |
|---|---|
✅ [Event] tracked |
Event successfully sent to Eulerian Marketing Platform |
🚫 Skipped [event] |
Event skipped due to page context rules |
❌ EA_collector not available |
Eulerian tracking library script not loaded |
❌ [Data] not found |
Required event data is missing |
The pixel automatically tracks these customer events:
| Event | Trigger | Data Captured |
|---|---|---|
| page_viewed | Generic page visits | User ID, Event type, URL |
| product_viewed | Product page visits | User ID, Product ID, Product name, Category |
| product_added_to_cart | Add to cart action | User ID, Product details, Price, Category |
| checkout_completed | Purchase completion | User ID, Order ID, Total amount, Line items |
- Set debug to false: Change
CONFIG.debugtofalse - Test all events: Verify tracking works on all page types
- Check Eulerian dashboard: Confirm data appears in your analytics
- Monitor for errors: Watch for console errors after going live
const CONFIG = {
scriptSrc: "https://YOUR-TRACKING-DOMAIN/ea.js",
debug: false // Set to false for production!
};For technical support:
- Check console logs with debug mode enabled
- Verify your Eulerian subdomain is correct
- Test with different browsers to isolate issues
- Contact your Eulerian Marketing Platform support team for analytics-specific questions
This integration code is provided as-is for Eulerian Marketing Platform customers.
Need help? Make sure to test thoroughly with debug: true before switching to production mode!