Shopify / hydrogen

Hydrogen lets you build faster headless storefronts in less time, on Shopify.
https://hydrogen.shop
MIT License
1.33k stars 257 forks source link

Issue with Tracking Pixel Events Using Shopify Documentation #2328

Open Kh-Farhan opened 1 month ago

Kh-Farhan commented 1 month ago

What is the location of your example repository?

No response

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

"2024.4.3"

What version of Remix are you using?

"2.9.2"

Steps to Reproduce

Description:

We are experiencing issues with tracking pixel events on our Shopify storefront, despite following the official documentation. Events are not firing. Although according to this thread Hydrogen now has the analytics Specifically on Shopify Admin's console we can see this error logged:

Uncaught Error: Error producing to the Monorail Edge. Response received: {"status":400,"message":"Schema validation error: [schema_id=admin_pixel_helper_button_click/1.0], [error=script_version: expected value '17' to be of type 'string', but got 'float64']"
 at an.produce (common-jgDv7bsk9FUc.js:55:11654)

So it might have something to do with monorail edge.

Expected Behavior

Pixel events should track accurately and run the logic added to different events.

Actual Behavior

blittle commented 1 month ago

Are there any console warnings in the browser when running locally in dev mode? Or warnings in the server logs?

Kh-Farhan commented 1 month ago

Are there any console warnings in the browser when running locally in dev mode? Or warnings in the server logs?

There are no console warnings when running locally in dev mode, but there is one on Shopify Admin's console i.e:

Uncaught Error: Error producing to the Monorail Edge. Response received: {"status":400,"message":"Schema validation error: [schema_id=admin_pixel_helper_button_click/1.0], [error=script_version: expected value '17' to be of type 'string', but got 'float64']"
 at an.produce (common-jgDv7bsk9FUc.js:55:11654)

Not sure if its relevant to this problem or not but thats the only Error we can see.

Also request to Monorail Edge url ( as explained in the Docs ) is returning 200, So no errors on Hydrogen store locally.

michael-convertdigital commented 1 month ago

@blittle is it possible to fire Shopify Pixel events from Hydrogen using the Analytics Provider?

blittle commented 4 weeks ago

@blittle is it possible to fire Shopify Pixel events from Hydrogen using the Analytics Provider?

@michael-convertdigital at the moment no, but pixel integration is on the roadmap.