Personalize Storefront messaging by referral source
If customers reach your Storefront through a partner or affiliate — a co-marketing page, an affiliate link, a partner's own website — you can greet them with a message that reflects where they came from, without needing a separate Storefront for every partner.
This combines Custom Code with a query string parameter you define and read yourself.
How it works
Unlike dnstemplateid and extuserid, which Storefront itself recognizes and stores, this pattern uses a parameter of your own choosing that only your own Custom Code reads — Storefront doesn't need to know about it.
- Choose a parameter name, for example
partner. - Give each partner a link to your Storefront with their own identifier attached:
https://yourstorefront.com?partner=acme-hosting
- In Custom Code, add a small script that reads the parameter from the URL and updates the page accordingly — for example, showing a partner-specific banner or message.
const params = new URLSearchParams(window.location.search);
const partner = params.get('partner');
if (partner === 'acme-hosting') {
// show a banner mentioning the partner, e.g.
// "You've been referred by Acme Hosting."
}A good use case
If you run a partner or affiliate program, each partner can get their own link with a unique identifier. A customer clicking through from Acme Hosting's website sees a banner acknowledging that referral, while a customer clicking through from a different partner sees their own — all from the same underlying Storefront, with no pricing or discount logic involved.
What to know
Because this reads directly from the URL using standard JavaScript, it works for any parameter name you choose — you're not limited to extuserid or dnstemplateid. The personalization only applies while the customer is on the page with that query string present. If you also want to track which partner a customer came from after they've registered — for reporting, commissions, or attribution — pair this with extuserid to store that information on the customer record itself. See Link Your Own Customer ID to Storefront for more on that.
Related articles
Updated 4 days ago