Capture referrals and create one-time use discount codes using Shopify


Connect your Shopify system with Referral Rock in order to:

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.



Add Conversion Tracking to your Order Status Page

  1. Navigate to your Shopify Admin Dashboard.
  2. Select Settings from the menu on the left side of the screen.
  3. Select Checkout, scroll down and select Order Processing, and then click Additional Scripts at the bottom.
  4. Enter your Shopify Event Script (example below) in the Additional Scripts box.
    1. You'll need to copy your Referral.js SDK script and put it above the conversion tracking script shown on line 1 in the example below.
  5. Save.

Need additional assistance? Reference Shopify's help documentation for Conversion Tracking

Example Conversion Script


<script type="text/javascript">
    window.referralJS = ((window.referralJS !== null && window.referralJS !== undefined) ? window.referralJS : {});
    window.referralJS.conversion = {
      debug: "false",
      parameters: {
        firstName: "{{customer.first_name}}",
        lastName: "{{customer.last_name}}",
        externalIdentifier: "{{}}",
        email: "{{}}",
        amount: "{{checkout.subtotal_price | money_without_currency}}"

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.

  1. Reference the instructions on the Shopify website under "Promote a discount using a shareable link" to create a discount code link
  2. Add your shareable link as the URL for your Webpage Redirect Referral Destination