User journey validation
User journey validation
This is for:
DeveloperThis article explains how to validate the proper operation of a basic customer user journey. This verification ensures the correct sequence of usage analytics events is sent to Coveo Usage Analytics (Coveo UA) and that the data remains consistent across events.
What’s a user journey?
A user journey is the sequence of actions a user may take while in a Coveo-powered commerce implementation. Actions are tracked as usage analytics events. Think of it as a path made up of different steps, all linked together like a story. It’s crucial to make sure that the sequence of events sent to track this journey is consistent and that the information between these events aligns correctly to validate the effectiveness of your Coveo implementation.
Key validation factors
To effectively test a user journey, you need to emulate the experience of a customer visiting your site. As you analyze the journey, consider the following:
-
Appropriate event triggering: Confirm that the correct event type is sent based on the relevant user interactions. For instance, when a product is added to the cart, ensure that the corresponding
add
event is logged. -
Correct logging of searches and clicks: Verify that the search and click events are logged with the valid
actionCause
values. -
Consistent
searchQueryUid
value in click events: Validate that the value transmitted in click events corresponds to thesearchQueryUid
value associated with the Search API request that resulted in the displayed product. -
Consistent client ID: Ensure that the client ID is the same throughout all events.
-
Alignment of product IDs: Confirm the consistent and accurate matching of product IDs. Verify that the product ID in events corresponds with the value in the catalog data. This alignment should remain consistent across all events related to the same product, including actions such as clicks, adding to cart, and purchases.
If your catalog entity contains variant data or product groupings, ensure that this data is transmitted with the events.
-
Aligning search hub values: For correct attribution, it’s important to ensure that the search hub value transmitted to the Search API follows certain naming conventions. Additionally, the
originlevel1
value insearch
andclick
events should correspondingly match the value of thesearchHub
sent to the Search API. -
Additional clicks for direct add to cart: Verify that adding a product to the cart directly from a Coveo-powered search results page, listing page or a recommendations component, triggers an additional click event.
-
Verify the accurate transmission of the
trackingId
field, ensuring its consistency across events. Additionally, validate its correspondence with thewebsite
field within thecontext
object of the Search API request. -
Ensure that duplicate events aren’t being emitted by verifying the outgoing network requests.
In the following sections, we will walk you through a specific user journey and verify the above criteria.
Sample user journey
Outlined below is a sample user journey. You can replicate this user journey for your implementation by following the steps shown. While interacting with your site, pay close attention to the events transmitted to Coveo and validate the specified checks in this section. Examine these events using the Network tab in your browser’s developer tools. Subsequently, compare these events with the observations alongside the data presented in the Coveo Administration Console.
From a high level perspective, the following is what the user journey will look like:
Search → Click → Product detail page (PDP) → Add to cart → Purchase
On the main landing page, a user enters the name of a product they intend to purchase. Subsequently, a results list is presented, from which they can choose the specific product they wish to acquire. After selecting their desired product, they proceed to add it to their cart and initiate the checkout process.
-
Search: Load the home page of your website, open the developer tools, and ensure that the network log recording is enabled. To only see requests sent to Coveo, input
v15/analytics
in the filter box.Conduct a search using the search box on the home page and validate the following:
-
A
search
event is sent to Coveo. -
The
actionCause
parameter of this event issearchBoxSubmit
. -
Validate that the value of the
originLevel1
field in the UA request matches the value of thesearchHub
in the corresponding Search API request. This value should also adhere to the appropriate naming conventions. -
Pay attention to the
trackingId
field on the UA event request. The value of this field should match the value of thewebsite
field within thecontext
object of the Search API request. -
Take note of the
searchQueryUid
andclientId
values from the payload. We will need these for the subsequent steps.
-
-
Click: Click a product on the search results page and confirm the following:
-
A
click
event is sent to Coveo. -
The
actionCause
parameter of this event isdocumentOpen
. -
Verify that the
searchQueryUid
and theclientId
values match the ones noted for the search event. -
Validate that the value of the
originLevel1
field in the UA request matches the value of thesearchHub
in the corresponding Search API request. This value should also adhere to the appropriate naming conventions. -
Note the
contentIDValue
from thecustomData
key, which represents the ID of the clicked product. -
Verify that the value of the
trackingId
field matches the value noted in the previous step.
-
-
Product detail page (PDP): Once clicked upon, the PDP will display more information about the product. On opening the PDP, observe the following:
-
A product detail view event is sent. Identify the event by verifying the
pa
parameter.-
For the product detail view event, the
t
parameter should beevent
and thepa
parameter should bedetail
.
-
-
Verify the following:
-
Client ID, as highlighted by the
cid
field here, matches theclientId
noted from the click event. -
Ensure that product identifiers align by validating that the
pr1id
field matches thecontentIDValue
noted from the click event. -
Verify that the value of the
trackingId
field matches the value noted in the previous steps.Figure 1. Product detail view event request
-
-
-
Add to Cart: When an "Add to Cart" button is selected, confirm the following:
-
An add to cart
collect
event is logged, with thepa
key set toadd
. -
If a single product is added, the
pr1id
key should match the product ID noted from the click event. -
Validate if the client ID and
trackingId
values are consistent, as done in the previous step. -
Confirm that the
pr1id
field matches thecontentIDValue
noted in the previous step.
-
-
Purchase the item: A purchase
collect
event should be logged, with thepa
key set topurchase
. Conduct the same checks on the client ID, product ID andtrackingId
fields as done above. -
Confirm events in the Coveo Administration Console: Navigate to the Visit Browser to verify if the events sent in the preceding steps are logged here.
Create a filter to view only the events sent by the client ID noted above, as shown in the screenshot below.
NoteA slight delay of a few minutes could occur before the events become visible in the Visit Browser.
Click the latest visit and go through the events given here to verify if they match those sent in the previous steps. Furthermore, as shown in the screenshot below, you can click an event to verify if the correct fields were logged.
Validating all user journeys
While the steps above focus exclusively on a singular user journey, they provide invaluable insights applicable to verifying other essential user journeys.
The example journey emphasizes the search aspect. Similar methodologies can be applied to instances where products are discovered through recommendations or product listing pages.
We recommend that you start by identifying all potential Coveo-related user journeys, from product exploration to purchase. Subsequently, these journeys should be validated against the key validation factors outlined in this article.