Introduction
With code-based referral tracking, each of your community members gets their own unique discount code to share with friends and followers. When someone uses that code at checkout, the sale is attributed to the member who owns it.
To make this work, you create one base discount in Shopify. SocialLadder uses it as a template: when a member is assigned their referral code, we create it under your base discount, so it inherits the same rules (discount value, eligible products, minimum purchase, and so on). Each member has a single referral code.
How It Works
Step | What happens |
You create a base discount in Shopify | You define the discount value and rules once. |
You share the discount ID with SocialLadder | We link your base discount to your program. |
A member is assigned their referral code on SocialLadder | SocialLadder creates the member's unique code under your base discount, using the same rules. |
A customer uses the code at checkout | The sale is tracked and attributed to that member. |
Before You Start
Code-based tracking requires the Shopify-SocialLadder custom app. If you haven't created it yet, follow How to Install the Shopify-SocialLadder Integration first, then come back to this guide.
Make sure that:
The SocialLadder custom app is installed on your store
You have shared your Client ID, Client Secret, and shop direct link with your SocialLadder team
You have permission to create discounts in your Shopify admin
The access scopes listed in the installation guide already include everything code-based tracking needs, so you don't need a separate app or new permissions.
Step 1: Create the Base Discount
In your Shopify admin, go to Discounts in the left menu.
Click Create discount.
Choose the discount type that matches your offer, such as Amount off order, Amount off products, or Free shipping.
Select Discount code as its type, and give it a name. This is the name of your base discount where all discounts will be nested, for example TENOFF.
Set the discount value and any conditions you want every referral code to follow, such as eligible products, minimum purchase requirements, customer eligibility, and combinations with other discounts.
Click Save.
All discount rules are managed in Shopify, not in SocialLadder. The discount value, free shipping, eligible products, minimum purchase, and any other conditions come from the base discount you set up here. SocialLadder uses these rules as they are to create your members' referral codes. To change what a code offers, edit the base discount in Shopify.
Step 2: Find the Discount ID
Go back to Discounts and click the base discount you just created.
Look at the URL in your browser's address bar. The number at the end is your discount ID.
For example, in your-store.myshopify.com/admin/discounts/1234567890, the discount ID is 1234567890.
Step 3: Share the Discount Details with SocialLadder
Send the following to your SocialLadder Implementation Representative or Customer Success contact:
Item | Where to find it |
Discount ID | The number at the end of the discount URL (Step 2) |
Discount value | The percentage or amount you set in Step 1, for example 10% off |
Once we have these details, your SocialLadder team will connect the base discount to your program, and your members will receive their referral codes.
Viewing Member Codes in Shopify
Every member code SocialLadder creates appears inside your base discount. To see them, open the base discount in Discounts and click View all codes. As members are assigned their referral codes, they're added to this list.
Optional: Add Link-Based Tracking
Code-based and link-based tracking can run at the same time. With both enabled, members can share their referral code, their referral link, or both, and sales from either are attributed to them.
To set up link-based tracking, see Installing the SocialLadder Shopify Integration for Link-Based Tracking.
Troubleshooting
If referral codes aren't behaving as expected, start with these common cases. Most can be solved directly from your base discount in Shopify.
Referral codes stopped working for everyone
Open your base discount in Shopify and check that it's still active and doesn't have an end date in the past. Since every member code inherits these settings, reactivating the base discount or removing the end date restores all codes.
A customer says a referral code doesn't apply at checkout
Check the conditions on your base discount. A minimum purchase requirement, product restrictions, customer eligibility rules, or combination settings may be preventing the code from applying to that cart.
I want to change the discount value
Edit the value on your base discount in Shopify. The change applies to all existing member codes. Let your SocialLadder contact know the new value so it's reflected correctly in your program.
Related articles:





