How does cookie consent affect referral attribution?
Cookie consent decides whether Simple Affiliate sets its referral cookie, counts the click, and shows the referral popup. It doesn't stop the affiliate code on the Shopify cart, so a referred order can still be credited when the customer gives no consent.
These storefront steps run in the Simple Affiliate tracker. Turn on Simple Affiliate Tracker in your theme's App embeds and click Save, or none of them runs. The steps are in How to enable the Simple Affiliate tracker.
What needs consent
Simple Affiliate asks Shopify whether the customer can be tracked, and waits for a yes before it:
- sets the
sarefcookie, - counts the link click,
- shows the referral popup, including the claim popup of single-use discount codes.
Simple Affiliate does not decide on its own what consent is sufficient. Shopify's decision can vary by the customer's consent choices, country, and the privacy rules that apply, so selecting only Necessary cookies may allow tracking for one customer but not another. To check Shopify's current decision, run Shopify.customerPrivacy.userCanBeTracked() in the browser console. It returns true or false.
The referral cookie
The saref cookie is set on your storefront domain and lasts 90 days. It holds the affiliate's link code and a signed token. You can find it in your browser's developer tools, under the cookies of your store. The conversion window of the affiliate's group limits how long the cookie click counts at checkout.
What works without consent
When a customer opens a referral link, the tracker adds an Affiliate code attribute to the Shopify cart at once, without waiting for consent. The attribute stays on that cart until the customer checks out, empties it, or Shopify drops the cart, and Simple Affiliate reads it from the order. So a link referral can be credited even when the cookie was never set, and also after the conversion window of the cookie click, while the customer keeps the same cart.
Discount codes typed at checkout, connected customers, and product attribution don't depend on the cookie either.
When a referral is created
The referral is created when the order is placed, not when the link is opened. A counted click is a statistic, not a saved record that guarantees a later referral.
Changelog releases
This topic appears in the following release notes: