Publishing Custom Customer Events from a Hydrogen App

Hello,

Is there a way for me to publish Custom Customer Events from a Hydrogen App?

I currently use a Custom Web Pixel to handle analytics for user checkout, it would be great if I could handle custom events in the same way, so I can have the code for sending data to all the third party analytics tools in the same entry point.

From a Hydrogen App, I hope I would be able to run something like

Shopify.analytics.publish('custom_event_name', data)

Edit: Typo

2 Likes