How does Simple Affiliate track referral links, and how does cookie consent affect attribution?
Simple Affiliate tracks referral links with two separate storefront mechanisms: a saref cookie that follows Shopify's tracking decision, and an affiliate code on the Shopify cart that does not wait for tracking 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 neither mechanism runs. The how-to is at https://simple-affiliate.com/blogs/how-to-guides/how-to-enable-the-simple-affiliate-track-app-embed
Referral cookie
The cookie is named saref and uses your store's domain. It contains referral information, including the link ID. You can look for it in your browser's developer tools under cookies for your store's domain.
Cookie consent and click tracking
Simple Affiliate asks Shopify whether the customer can be tracked. The tracking cookie and the click count depend on Shopify allowing tracking. Simple Affiliate does not independently decide what consent is sufficient.
Shopify's decision can vary by the customer's consent choices, country, and applicable privacy rules. 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.
Shopify cart attribution
When a customer uses a referral link, Simple Affiliate adds the affiliate code (sacode) to the Shopify cart without waiting for tracking consent. This is separate from the saref cookie and from click counting.
The code stays on that cart until the customer checks out, empties it, or Shopify drops the cart. Cart attribution can therefore work even when the tracking cookie is not set.
When a referral is created
Simple Affiliate does not save a visitor or session attribution record on its servers when the link is clicked. The referral is created when the order is placed. A counted link click is not a saved visitor or session record that guarantees later attribution.
Changelog releases
This topic appears in the following release notes: