How do I run a refer-a-friend campaign?

Although we're working on our own built in refer a friend tools, in the mean time we do recommend using  ReferralCandy which is a simple tool to power refer-a-friend campaigns to allow your customers to refer more their friends and both of them benefit from it.

How to Integrate with ReferralCandy

To integrate Subbly with ReferralCandy, you need to use the  Advanced Javascript-only integration. Feel free to read some of that article to get an idea why and how it works.

But if not here are the steps for integrating...

  1. Get your javascript code
  2. Get your App ID
  3. Get your Secret Key
  4. Paste your code into the Subbly Conversion Tracking code editor
  5. Edit the code with the Subbly template variables

Let's go into further detail.

Step 1: Get your javascript code from ReferralCandy

If you haven't signed up sign up to  ReferralCandy. The Advanced Javascript snippet can be found on the Integration page of your ReferralCandy dashboard.

Step 2 & 3: Get your App ID and Secret Key from ReferralCandy

The App ID and Secret Key can both be found in the "Plugin tokens" section of your  admin settings page.

Step 4: Paste your Javascript code into Subbly

First go to the Tracking Code page which can be accessed from the left hand main navigation.

Then paste your ReferralCandy javascript code into the text box like so...

Ok good work!

Step 5: Add the Subbly template variables

This step may look scary and look fiddly, but stick with it, it's not too bad. If you get stuck just remove the code and start again.

We need to modify the first part of the ReferralCandy code pasted in the Tracking Code textarea in previous step, to contain the Subbly template variables like this...

<div
  id="refcandy-popsicle"
  data-app-id="YOUR_APP_ID_GOES_HERE"
  data-fname="{{ customer.first_name }}"
  data-lname="{{ customer.last_name }}"
  data-email="{{ customer.email }}"
  data-amount="{{ order.amount }}"
  data-currency="{{ order.currency }}"
  data-timestamp="{{ order.timestamp }}"
  data-external-reference-id="{{ order.id }}"
  data-signature="{{ referralcandy_signature('YOUR_SECRET_KEY_GOES_HERE') }}"
></div>

Notice there are various tags for each data attribute, like {{customer.first_name}}, {{order.amount}}, etc. Please copy each of these respectively like above.

Please do not copy the whole chunk of code above as the id attribute might be different and needs to match the rest of the code snippet from ReferralCandy. Instead, please copy the individual template variables like {{ variable_name }} one by one inside the quotation marks to your code snippet that you pasted in the Tracking Code section of Subbly as per Step 4.

Make sure you replace "YOUR APP ID GOES HERE" with the App ID we got from Step 2, and replace "YOUR SECRET KEY GOES HERE" with your Secret Key from Step 3. Also note we have a special tag for the data-signature attribute which is a function that creates a special signature to inform ReferralCandy this is actually coming from us:  {{ referralcandy_signature('SECRET') }} you can see this above.

Step 7: Save!

Now you're ready to save your work. So go ahead and click save.

Now when the next customer goes through the checkout successfully the ReferralCandy code will trigger the conversion and pass the information required to them to handle the rest.

Congratulations you are now running a refer-a-friend campaign. Let us know if you have any questions or need any help with this!