Events
This documentation provides an overview of the events listener strategy and the different events you can listen to on the Hyperzod Ordering Website.
Below is the list of events available for listening:
Event | Description |
---|---|
add_to_cart | Triggered when a product is added to the cart. The event contains the product details. |
view_merchant | Triggered when a merchant is viewed. The event contains the merchant details. |
view_product | Triggered when a product is viewed. The event contains the product details. |
search_results | Triggered when a search is performed. The event contains the search query, search results for merchants, and products. |
place_order | Triggered when an order is placed. The event contains the order details. |
checkout_initiated | Triggered when checkout is initiated. The event contains the cart details. |
To fire a GTM (Google Tag Manager) custom event from JavaScript on place_order event. Push an event object to the data layer with the event property set to the name of the custom event like NewOrder
To set up more event listeners, you can use the following syntax:
Replace <event_name> with the name of the event you want to listen to (e.g., view_merchant, view_product, etc.). You can add your custom logic or a handler function inside the listener as required.
1. Navigate to your admin panel
2. To the left, click on "Settings"
3. Then click "Theme settings"
4. Inside you’ll find three sections Theme General, Custom Code, Header and Footer. Click on "Custom Code
5. Inside the Custom HTML section, choose “Custom HTML Head” and paste the “Event Listener Code” inside.
6. Now if you want to add pixel code for tracking.
case-1 : If you want to track only webs spefic events.
case-2 : If you want to track only app specific events.
case-3 : If you want to track both app and web specific events.
7. Lastly, click “Save”