Shopify
Natively capture referrals and add them as members; create one-time use discount codes.
This native connection is live and open to all customers while we finish rounding it out. Don't rely on it being final; behavior may change before general availability.
Overview
Connect your Shopify system with Referral Rock in order to:
- Track referral conversions from your Shopify store
- Fulfill rewards for referrals by applying a one-time use discount code at checkout
Native Connection (Customer Feed)
We recommend using our native Customer Feed capability to directly track referrals who convert via Shopify, and preload these customers as members.
How it works (trigger + objects):
- Trigger: an Order reaches
financial_status = paid. - Behavior: matching referral Approved across all programs; customer can be preloaded as a member.
- One-way read
Set up Customer Feed — API key (no OAuth pop-up)
- You'll need 3 pieces of information to setup this integration:
- Shopify Store Domain
- Client ID
- Client Secret
- Open Shopify Admin and copy the Shopify Store Domain from the store URL
- Create an Application and give it the following permissions (read only):
- read_orders
- read_customers
- Install the Application (from step 3) in your store (copy the Client ID and Client Secret Keys)
- In Referral Rock, find Shopify on the Integrations page and select Connect, or click here. Then, select Save & Verify Keys.
-
Add the Shopify Store Domain and your app's Client ID and Client Secret in the fields of the Link Shopify pop-up.

-
Follow the remaining steps to finish connecting Shopify.
Reward note: the Customer Feed approval can trigger a Reward Payout automatically.
Alternative — Conversion Tracking (SDK)
Integrating Conversion Tracking with Shopify is an alternative way to capture referrals from your store. The integration will tell us when a referral made a purchase, the dollar value of their purchase, and who the member was that referred them so that you can reward that member.
Prerequisites
- Installed Referral.js SDK
- Program's referral destination set to your Shopify site
Add Conversion Tracking to your Order Status Page
Navigate to your Shopify Admin Dashboard.
- Select Settings from the menu on the left side of the screen.
- Select Customer events from the menu on the left side of the screen.
- Click Add custom pixel, give your pixel a unique name, and click Add pixel.
- Enter your Conversion Script (example below) in the Code box.
- You'll need to copy your Referral.js SDK script content and put it above the conversion tracking script shown on line 1 in the example below. When copying your Referral.js SDK script, only copy the content between the <script> and </script> tags. Do not include the tags themselves.
- Click Save and Connect.
Need additional assistance? Reference Shopify's help documentation for Conversion Tracking
Example Conversion Script
// ADD THE SDK SCRIPT CONTENT HERE WITHOUT <script> and </script> tags
analytics.subscribe("checkout_completed", async (event) => {
window.referralJS = ((window.referralJS !== null && window.referralJS !== undefined) ? window.referralJS : {});
window.referralJS.conversion = {
debug: "false",
parameters: {
email: event.data.checkout?.email,
firstName: event.data.checkout?.billingAddress?.firstName,
lastName: event.data.checkout?.billingAddress?.lastName,
externalIdentifier: event.data.checkout?.order?.id,
amount: String(event.data.checkout?.subtotalPrice?.amount)
}
};
});Check out Shopify's list of Checkout Objects for more custom info that you can send back with the conversion script.
Apply a One-Time Use Discount Code at Checkout
Automatically apply a one-time use discount code for referrals to use on checkout. The discount code associated with the link applies automatically to your customer's next checkout cart, or to any active carts they have open.
- Reference the instructions on the Shopify website under "Promote a discount using a shareable link" to create a discount code link
- Add your shareable link as the URL for your Webpage Redirect Referral Destination
Updated 10 days ago