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

  1. A participant shares their unique referral link (e.g., yoursite.com?ref=REF-XYZ789)
  2. When someone clicks the link, the tracking script stores the referral code
  3. When the referred user signs up or makes a purchase, Blitz Rocket attributes it to the referrer
  4. Both the referrer (advocate) and the referred user (friend) can earn points

Referral Flow

Advocate shares link → Friend clicks link → Visit tracked →
Friend signs up → Signup tracked → Points awarded →
Friend purchases → Purchase tracked → More points awarded

Setup

  1. Enable referral tracking in your contest settings
  2. Add the Blitz Rocket tracking script to your website
  3. Configure point rewards for advocates and friends
  4. Share the referral widget with your participants

Tracking Script

Add this script to your website. See Tracking Script for full implementation details.

<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:

// Track a signup
window.RocketTracker.trackSignup("[email protected]");

// Track a purchase
window.RocketTracker.trackPurchase("order-123", 49.99, "USD", "[email protected]");

// 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:

EndpointPurpose
POST /api/referral/track-visitTrack a referral link visit
POST /api/referral/track-signupTrack a referred signup
POST /api/referral/track-purchaseTrack a referred purchase
GET /api/referral/validate-codeValidate a referral code