Skip to main content

Show campaign content across sessions and pages using stored URL parameters

Fresh Relevance can display campaign-specific banners or SmartBlocks based on how a visitor first arrived at your site, even if the UTM or referral parameter disappears from the URL as the visitor browses.

Updated this week

Learn how to target campaign content so it persists across the full site visit and subsequent sessions. For example, a banner based on a Google Ads click can continue to show as visitors navigate between pages, even if they are not logged in or identified.


When is this useful

  • Keep influencer or partner offers visible even on later visits — just because the UTM isn’t in the URL anymore, doesn’t mean your campaign experience should end.

  • Target returning, anonymous, or known shoppers with persistent promo content tied to their first entry point.

  • Offer a tailored experience when a visitor lands from a Google Ad, Facebook campaign, affiliate, or email click.


Targeting using standard URL fields

In most cases, Fresh Relevance tracks UTM parameters such as utm_source, utm_campaign, and utm_content automatically. You can set up Slot rules using the Latest URL field value for these standard parameters.

When creating your Slot rule, select Latest URL Field Value from the rule type list, then choose the relevant UTM field, such as utm_source or utm_campaign.
This rule type is available under the URL fields rule category.

These rules are suitable if you only need to persist targeting within the current session and you are using standard UTM parameters.

For example, if you create a rule to display a banner when utm_source=google, this is applied automatically for the duration of the session. No additional scripting is required.


Understand URL‑based rule behaviour

Different URL‑based rules are evaluated in different ways:

  • Current Page > URL rules work in real time and are best for targeting content when the current page URL contains a UTM or other query parameter.

  • Current Session > First Page Visited rules are session‑based and may take a short time to apply if a visitor moves between pages quickly.

If you need campaign content to persist reliably across pages or sessions, using the first page visited for Slot targeting provides the most consistent results.


Advanced: targeting based on the first page visited

If you need campaign content to persist reliably across multiple pages or sessions, Fresh Relevance offers several approaches depending on your requirements and timing tolerance.

For example, a visitor lands at /landing?utm_medium=cpc, and you want a SmartBlock to display everywhere for that visitor, even after they come back to the site later and the UTM is absent. This approach supports both anonymous and identified users.

1. Store the first page visited

Fresh Relevance can store the first page a visitor accessed and make it available for targeting.

This requires configuration by the Fresh Relevance team, as you can’t modify the base tracking script or pass merge parameters into Slots using client‑side code.


Contact Fresh Relevance Support to implement tracking for the initial landing page URL in the browser’s localStorage.

2. Add first_page_visited to merge parameters

  1. Edit your Slot in Fresh Relevance.

  2. Add first_page_visited to the Merge parameter names field.

3. Create Slot rules referencing the custom field

  1. Set rules such as:
    “If first_page_visited contains utm_medium=cpc, display SmartBlock X.”

  2. When creating your Slot rule, ensure you use the Merge Field configuration to target first_page_visited as shown below.

  3. Set the field to first_page_visited, choose string (text), select contains, and enter the value you want to match, for example, utm_medium=cpc.

This rule persists for as long as localStorage is present in the browser.

4. Test

  1. Open a campaign link, for example, https://yourstore.com/?utm_source=affiliate.

  2. Navigate to other pages and confirm that the campaign content or offer still appears.

  3. Test with a fresh browser profile to simulate a new visitor.


Choose the right approach

  • Use Latest URL Field Value rules for simple, single‑session campaign targeting.

  • Use Current Page > URL rules for real‑time page‑specific messaging.

  • Use first page visited targeting when campaign content must persist across pages and sessions, even when UTMs are no longer present.


Notes and best practices

  • Standard “Latest URL Field Value” rules suffice for most campaign targeting.

  • Use first_page_visited when you need to persist content display beyond a single session or when targeting based on more complex landing page criteria.

  • If a user clears localStorage, the tracking will reset.

  • You may combine rules, for example, targeting based on either the current URL or first_page_visited.

Did this answer your question?