What the Shopify integration can and can’t do
Before you start
You’ll need:- Owner or staff access to your Shopify admin with permission to install apps and edit your theme.
- A Referly account. You can install the app first and create your program during the connect flow, or set your program up first — either order works.
- A decision on how affiliates will promote you — referral links, discount codes, or both. See Tracking methods.
Step 1: Install the Referly app on your store
Open the app listing
Install the app in Shopify
Choose which program to connect
Confirm
Check the confirmation
What the app sets up for you
You don’t have to create API keys, paste an access token, or add anything in Shopify’s notification settings. During install, the app:- Starts listening for paid orders and refunds in your store.
- Installs the tracking piece Shopify uses on its own checkout, so orders are reported even though the checkout page isn’t yours to edit.
- Records which Referly program the store belongs to, so orders land in the right place.
- Adds your store’s address as a link destination for your affiliates, so their referral links point at your storefront out of the box.
Step 2: Add the tracking script to your theme
The app handles orders. The script handles everything before the order: it recognises a visitor who arrived from an affiliate link, records the click, remembers who referred them, and attaches that referral to their cart so it survives into checkout.Open your theme code
Open theme.liquid
theme.liquid. This is the file every page of your store loads, which is why the script goes here rather than on one page.Paste the script
head tag near the top of the file and paste the script on the line just above it.Save
Step 3: Decide how affiliates will promote you
Referral links
Each affiliate gets a link that points at your storefront with their reference on the end. When someone follows it, the script records the click and attaches the referral to their cart. Nothing else is needed. If you want shorter, tidier links —your-store.com/sarah rather than a long parameter — turn on automated short links. Referly creates the redirect inside Shopify for you, and can optionally apply the affiliate’s discount automatically when the link is used.
Discount codes
Discount codes work with no script and no click at all — the code the customer types is what identifies the affiliate. This is the most reliable option for stores with heavy ad blocking or lots of traffic from apps. Referly can create the codes directly in your Shopify store, so you don’t create them by hand in Shopify’s Discounts section. Set this up on the Coupons page: create a coupon, choose Shopify as the source, and assign codes to affiliates. See Connect a coupon source and Create coupons.How Referly decides who gets credit for an order
When an order is paid, Referly works through three checks, in this order, and stops at the first one that finds an affiliate.The discount code on the order
The referral attached to the cart
The tag on the customer
What Referly writes back into Shopify
Once an order is credited, Referly labels it in your Shopify admin so you can see attribution without leaving Shopify:- The customer is tagged, which is what makes repeat orders keep earning.
- The order is tagged with the affiliate behind it, and with the link or discount code that was used.
Step 4: Place a test order
Get a real affiliate's link
Visit your store through it
Check the click was recorded
Place an order
Check Shopify
Check Referly
Refunds and cancellations
When you refund an order in Shopify, Referly finds the matching sale and marks it as refunded. The affiliate’s totals are recalculated so a refunded order isn’t paid out on. A refund is only applied while the commission is still on hold. If the affiliate has already been cleared for payout on that sale, the sale stays as it is — adjust it by hand if you want to claw it back. See Refunds and Reward holds. Cancelling an order in Shopify without refunding it doesn’t change anything in Referly. Issue the refund if you want the commission reversed.Billing when you install through Shopify
If you found Referly through the Shopify App Store and installed it there, your Referly subscription is billed through Shopify and appears on your Shopify invoice alongside your other apps. Changing or cancelling it is handled the same way as any other Shopify app charge. Everything else — your plan’s features, limits, and add-ons — works exactly as described in Plans and features.Disconnecting your store
In Referly, open Connect Integration, select Shopify, and choose Disconnect. Referly stops receiving orders from that store immediately. Nothing you’ve already tracked is deleted — your affiliates, referred customers, sales, and rewards all stay. Orders placed while you’re disconnected are not recorded and won’t be picked up if you reconnect later. If you’d rather remove the app from Shopify’s side as well, uninstall it from your Shopify admin. Remember to take the tracking script out of your theme if you’re leaving for good.Troubleshooting
Orders are appearing in Referly with no affiliate attached
Orders are appearing in Referly with no affiliate attached
No orders are appearing at all
No orders are appearing at all
Clicks aren't being counted
Clicks aren't being counted
Discount code orders aren't being credited
Discount code orders aren't being credited
An order was skipped entirely
An order was skipped entirely
A returning customer's order went to the wrong affiliate
A returning customer's order went to the wrong affiliate