Surfacing a comparison module for returning visitors who viewed a product
Our shoppers research for days before buying. The funnel step I am targeting is the return visit: someone viewed a product page, left, and comes back to the home page later in the week.
For those visitors I want to show a spec-comparison module on the home page instead of the generic hero.
How do I express that audience? Specifically the combination of "is a returning visitor" and "has viewed a product page before".
1 answer
Both halves of your audience are built-in conditions, so this is a dashboard exercise.
The returning part is literally user is returning. The page-history part uses the viewed-page condition, for example:
user is returning and user has viewed a page with path "/products/nova-x2"Adapt the path to your product routes, or use matches for a pattern that covers the whole catalog section you care about.
You do not need any custom tracking for the signal: product views are auto-tracked by the Hydrogen SDK, so the browsing history is already on the profile.
For the module itself, map it to a slot and fetch it in the home route loader. Since the audience is evaluated when the loader resolves the slot, returning visitors get the comparison module in the server-rendered HTML on first paint, not swapped in afterwards.