Referral Tracking
Referral Tracking
Track visits, signups, and purchases through referral links
Referral Tracking
Blitz Rocket's referral tracking system allows you to embed a lightweight JavaScript snippet on your website to automatically track referral visits, signups, and purchases. Each contest participant gets a unique referral code that they can share.
How It Works
- A participant shares their unique referral link (e.g.,
yoursite.com?ref=REF-XYZ789) - When someone clicks the link, the tracking script stores the referral code
- When the referred user signs up or makes a purchase, Blitz Rocket attributes it to the referrer
- Both the referrer (advocate) and the referred user (friend) can earn points
Referral Flow
text
Advocate shares link → Friend clicks link → Visit tracked →
Friend signs up → Signup tracked → Points awarded →
Friend purchases → Purchase tracked → More points awarded
Setup
- Enable referral tracking in your contest settings
- Add the Blitz Rocket tracking script to your website
- Configure point rewards for advocates and friends
- Share the referral widget with your participants
Tracking Script
Add this script to your website. See Tracking Script for full implementation details.
html
<script
src="https://blitzrocket.com/referral-tracker.js?campaignId=YOUR_CAMPAIGN_ID&autoInject=stripe"
async
></script>
Once loaded, use the RocketTracker global to track events:
javascript
// Track a signup
window.RocketTracker.trackSignup("user@example.com");
// Track a purchase
window.RocketTracker.trackPurchase("order-123", 49.99, "USD", "user@example.com");
// Get the current referral code
const code = window.RocketTracker.getReferralCode();
API Endpoints
If you prefer to handle tracking server-side, you can use the Referral API Endpoints directly:
| Endpoint | Purpose |
|---|---|
POST /api/referral/track-visit | Track a referral link visit |
POST /api/referral/track-signup | Track a referred signup |
POST /api/referral/track-purchase | Track a referred purchase |
GET /api/referral/validate-code | Validate a referral code |