- Check that dynamic checkout variables are available on your store platform.
Customize and insert the purchase and referral tracking code into your purchase complete page just before the </body> tag. Refer to the screenshot below:
The App ID and Secret Key are in the "Plugin tokens" section of your profile page.
You must replace the following dummy fields in the code snippet with dynamic checkout data from your store platform:
- data-fname: Customer First Name
- data-lname: Customer Last Name
- data-email: Customer Email Address
- data-amount: Invoice Amount
- data-currency: Invoice Currency (3 letter code)
- data-timestamp: Purchase Timestamp (UNIX time)
- data-external-reference-id: Invoice Number
- data-accepts-marketing: true/false (whether the customer has consented to marketing). This is an optional field*.
- data-signature: Calculated from the MD5 digest of a string containing the email address, first name, invoice amount, order timestamp, and secret key (in that order) separated by commas. Please double check that this is done properly otherwise it will result in a checksum error.
Note: the MD5 signature is calculated based on the following items: MD5(EMAIL,FIRST_NAME, INVOICE_AMOUNT,TIMESTAMP,ACCOUNT_SECRET)
*If you only want to enrol customers who have consented to marketing in the referral program, you need to let us know whether they have consented. You can do this by populating the 'data-accepts-marketing' field when the script is loaded. If 'data-accepts-marketing' is set to false, the customer will be unsubscribed and banned from the referral program.
Here's a worked example for your reference:
App ID: THISISMYID
Secret Key: THISISMYKEY
If you have the following invoice,
Name: John Smith
Invoice Amount: USD$10.20
Order Timestamp (in UNIX time): 1396927808
In this example, MD5("firstname.lastname@example.org,John,10.20,1396927808,THISISMYKEY") = eacb54f62a2d989bed54d02f4a171e94
The corresponding div element should therefore be:
<div id="refcandy-mint" data-app-id="THISISMYID" data-fname="John" data-lname="Smith" data-email="email@example.com" data-amount="10.20" data-currency="USD" data-timestamp="1396927808" data-locale="en" data-signature="eacb54f62a2d989bed54d02f4a171e94"></div>
Does my integration work?
You pasted your tracking code on your site and want to know if your integration is working. Here's how you can test your integration:
1. First, make a test purchase at your store and look for these signs:
a. Does the purchase show up on your Purchases and Referrals page?
If there is no purchase on the page, it means that we couldn't detect purchases and referrals on your site.
Looking at Checksum Errors might help you to troubleshoot.
b. Are there checksum errors?
Go to your Dashboard and check under My Store to see if you have the Checksum Error page.
If you do not have it, it means either that the purchases are being tracked correctly, or you have not sent any purchases to us.
If you have Checksum Error page, it means that there are errors in your tracking code. This might mean that you have not put the tracking code correctly on your site, or there maybe a checksum error.
For example, the screenshot below shows that we did not receive "First name" field from your tracking code.
2. Second, make a test referral
a. Activate your referral program
b. Invite yourself as an advocate (See our guide on invite advocate)
c. Share your invite link with a friend (It could be someone from your team, who will access the link from a different device)
d. The referred friend uses the invite link to make a purchase at your store
e. The referred purchase should meets the criteria for a reward. The referred friend should not use the same name and email address as the your test advocate.
After 12 hours, if this purchase showed up on the Purchases and Referrals page as a referred purchase, your integration is completed.
If the purchase does not show up, follow this guide to Troubleshoot your referral detection