How does referral attribution work on a headless Hydrogen storefront?
Simple Affiliate attributes a Hydrogen order when a supported affiliate signal reaches the completed Shopify order and the order meets your program rules. For referral links, the Hydrogen integration can pass the affiliate code through a hidden _sa_code attribute.
An affiliate's public referral URL still carries a tracking code such as sacode. The hidden _sa_code attribute is the storefront-to-order handoff used during checkout; affiliates and customers don't enter it themselves.
From referral link to order
- An affiliate shares a referral link containing their tracking code.
- Your Hydrogen storefront retains that code during the customer's visit.
- The storefront passes the code into Shopify through the hidden
_sa_codeattribute. - Simple Affiliate reads the completed order and applies your configured attribution and commission rules.
A link click alone doesn't guarantee attribution. The completed order must contain a supported attribution signal. Unique discount codes and Pro connected-customer attribution can also identify an affiliate when their respective requirements are met.
Test the integration
- Confirm your storefront settings on the Headless setup page.
- Open a real affiliate referral link on the published Hydrogen storefront.
- Complete a test order through Shopify checkout.
- Open the order in Simple Affiliate.
- Verify the assigned affiliate.
- Verify the calculated commission.
A headless install check doesn't require the Simple Affiliate Tracker theme app embed. The reference Hydrogen recipe is also optional, but your implementation must preserve the affiliate code through checkout for link-based attribution.
If the order isn't attributed, confirm that the referral URL contains sacode, the headless storefront settings are confirmed, and your Hydrogen implementation passes _sa_code into the order. For discount-code attribution, confirm that the code appears on the order. For connected-customer attribution, confirm that the Pro feature is enabled and the customer completed the required first referred purchase.
For an order that was attributed, Shopify Sidekick can explain the recorded reason for the attribution.
Changelog releases
This topic appears in the following release notes: