Get Started with SweetRef#
Welcome to SweetRef! This guide will help you set up your referral program quickly and easily.Quick Start#
2.
Set up your program details.
3.
Add the SweetRef script to your website.
4.
Configure event tracking.
5.
Launch your referral program!
Installation#
1. Add the Script#
Place the following script in your website's <head>
section:Replace YOUR_PROGRAM_ID
with the ID provided during onboarding.
Event Tracking#
To ensure accurate tracking of referrals, you need to read the sweet_ref
from the user's cookies and include it as REFERRAL_CODE
in your signup and payment tracking requests.Reading the sweet_ref
Cookie#
Add the following function to read the sweet_ref
value:1. Track User Signups#
When a user signs up, track the event and include the REFERRAL_CODE
:2. Track Payments#
Record successful payments to attribute them to the correct referrer:3. Track Refunds#
Record any refunds to maintain accurate program statistics:Note: Replace all placeholder values (USER_ID
, YOUR_API_KEY
, etc.) with your actual data.
Verification#
After installation, check for a sweet_ref
cookie in your browser to confirm proper setup. This cookie stores the referral code and should be included in your signup tracking request as ref_code
.Modified at 2024-11-17 13:47:51