Events - Summary

Prev Next

Accurate event tracking is essential for:

  • Model training, which in many cases relies on event data and real user behavior.

  • Analytics and performance reporting.

With this in mind, it is important to understand the context of each event and when or why it should be fired.
For more details on implementing event tracking through the XGen SDK, go here.

Core Events

Core events are foundational, site-wide interactions not tied to any specific tool or feature. These include:

  • Page View: A page_view event should fire any time a page loads.

  • Product View: A product_view event should fire any time a PDP loads, including the product code in the event context. This should fire in addition to page_view.

  • Category View: A category_view event should fire any time a PLP loads. This should also fire alongside page_view. This event should include both the category being viewed, as well as the first four products displayed in the category.

  • Purchase Order: A purchase_order event should fire whenever a purchase is completed, containing summary-level order data.

  • Product Purchase: A product_purchase event should fire once for each product included in an order.

Search Events

Search events capture all user interactions related to search behavior. These include:

  • Search: A search event is fired any time a user performs a search.

    • If search results appear as the user types, set is_type_to_search to true.

    • If the user performs a full/explicit search (e.g., submitting and viewing a SERP), set is_type_to_search to false.

  • Search Result: A search_result event is fired any time search results are returned and shown to the user.

    • If results are generated during type-to-search, set is_type_to_search to true.

    • If results appear during a full SERP view, set is_type_to_search to false.

  • Search Click: A search_click event is fired any time a user clicks a product from search results and navigates to a PDP.

Recommendations Events

Recommendation events capture interactions with recommendation modules. These include:

  • Element Impression: An element_impression event fires when a recommendation component loads, even if not visible in the viewport.

  • Element View: An element_view event fires when a recommendation component becomes visible in the viewport.

  • Element Click: An element_click event fires when a user clicks a product within a recommendation component, navigating to a PDP.