Shopify
Capture referrals and create one-time use discount codes using Shopify
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
Tracking Orders
Integrating Conversion Tracking with Shopify allows you 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
- This integration requires installation of Referral.js SDK.
- Make sure your program's referral destination is 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 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: {
firstName: event.data.checkout.billingAddress.firstName,
lastName: event.data.checkout.billingAddress.lastName,
externalIdentifier: event.data.checkout.order.customer.id,
email: event.data.checkout.email,
amount: event.data.checkout.subtotalPrice.amount
}
};
});
Checkout 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 5 months ago