Shopify

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

Overview

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.

🚧

Prerequisites

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 Customer events from the menu on the left side of the screen.
  4. Click Add custom pixel, give your pixel a unique name, and click Add pixel.
  5. 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 tags. Do not include the tags themselves.
  6. 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.

  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