When deduplicating results, you may come across cases where:
- A user lands on a product detail page (PDP) after clicking a product from a product listing page (PLP)
- They then select a different variant (e.g., color or size) - meaning the
objectIDchanges - and add that variant to their cart
In this situation, you may wonder if it is best to use the objectID of the variant that was originally returned on the PLP, or the one the user added to their cart from the PDP, when sending the addToCart and/or purchase events.
In general, it is best practice to send the objectID of the variant that was returned in the search results (ie. displayed on the PLP) and clicked on by the user, as opposed to the one added to cart/purchased.
This way, the click and conversion events are associated with the same objectID allowing the product's analytics to be tracked more accurately, as they will reflect the full user journey from search result to purchase.
Note that the queryID sent with the event will also be used to link the events back to the original search.