Skip to main content
All CollectionsReferrals & TrackingReferral Tracking Setup
Referral Tracking for Headless Shopify Stores
Referral Tracking for Headless Shopify Stores
Marcella Edwards avatar
Written by Marcella Edwards
Updated over 3 months ago

*Note: When following these steps be sure to begin by referencing the instructions outlined in this article.

For Shopify stores only, the Roster referral tracking script has the capability to auto apply a program's sharable discount code when an ambassador's referral link is clicked. This functionality works out of the box when connecting a standard Shopify store to Roster. However, if you are running a headless Shopify store there is an extra step you need to take...


Update Your Main Link Tracking Script

To ensure the sharable discount code is applied to the cart in a headless Shopify store you need to include this query string parameter in the script's URL.

Add the "fetch_shareable_code" URL parameter as follows:

<!-- Roster -->
<script async type="application/javascript" src="https://sa.getroster.com/sa.js?token=ACCESS_TOKEN&fetch_shareable_code=true"></script>

*Set your Access Token: be sure to replace the ACCESS_TOKEN placeholder with your public access token.

*Note: if you have other URL parameters in your script for additional use cases, be sure to leave them there.


Step 3. End to End Testing

You're done! Next it's time to test and verify things are setup properly.

View this article for steps on how to test your referral tracking script installation.


Troubleshooting and other Related Information

See Troubleshooting Referral Tracking Issues for more details on possible reasons why referrals are not always being tracked on your site.

Did this answer your question?