Trying to implement Shopify Web Pixel which is in Developer Preview. The pixel is not tracking any customer events. On checking the console found the error shown below. Any help would be appreciated.
The error suggests the web pixel is failing during JS initialization, which could explain why the customer events aren’t being tracked.
I’d first test the pixel with a basic event:
analytics.subscribe('page_viewed', (event) => {
console.log('page_viewed', event);
});
You can also temporarily use all_events to verify whether Shopify events are reaching the pixel at all.
If neither subscription fires, I’d focus on the cannot access ‘o’ before initialization error first. That points more toward an issue with the pixel code or one of its dependencies that with the individual customer events.
Also check whether the implementation is using browser APIs that aren’t available within Shopify’s Web Pixel sandbox.
If the goal is simply to connect Shopify’s customer events with GTM without maintaining the pixel implementation manually, there are also third-party solutions that handle this Web Pixel → GTM layer. For example, Webgarh’s GTM Assistant is one option in this area. I’d still recommend resolving the initialization error first if you’re troubleshooting the current custom implementation.
If page_viewed works but the other events don’t, then the next step would be to check the event-specific implementation.
