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:

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)

  1. You'll need 3 pieces of information to setup this integration:
    1. Shopify Store Domain
    2. Client ID
    3. Client Secret
  2. Open Shopify Admin and copy the Shopify Store Domain from the store URL
  3. Create an Application and give it the following permissions (read only):
    1. read_orders
    2. read_customers
  4. Install the Application (from step 3) in your store (copy the Client ID and Client Secret Keys)
  5. In Referral Rock, find Shopify on the Integrations page and select Connect, or click here. Then, select Save & Verify Keys.
  1. Add the Shopify Store Domain and your app's Client ID and Client Secret in the fields of the Link Shopify pop-up.

  2. 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

Add Conversion Tracking to your Order Status Page

Navigate to your Shopify Admin Dashboard.

  1. Select Settings from the menu on the left side of the screen.
  2. Select Customer events from the menu on the left side of the screen.
  3. Click Add custom pixel, give your pixel a unique name, and click Add pixel.
  4. Enter your Conversion Script (example below) in the Code box.
    1. 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.
  5. 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.

  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

Did this page help you?