Installation Guide

Set up Refgrow in minutes with these simple steps

Overview

Setting up Refgrow involves two essential components:

  1. Tracking Script - Placed on your website to detect referrals and track conversions
  2. Affiliate Dashboard - Where your affiliates manage their links and see their earnings
Quick Setup: Both components can be implemented with just a few lines of code.

Step 1: Add the Tracking Script

The tracking script handles referral detection, cookie management, and conversion tracking. Add it to all pages of your website:

<script src="https://refgrow.com/js/tracking.js" data-project-id="YOUR_PROJECT_ID"></script>
Important: Replace YOUR_PROJECT_ID with your actual project ID from your Refgrow dashboard.

What the Tracking Script Does

  • Detects when users arrive via referral links (?ref=CODE)
  • Stores the referral code in a cookie with your configured lifetime
  • Enables manual conversion tracking via the Refgrow() function
  • Provides helper methods for Stripe Payment Links

Placement

For optimal performance, place the script in the <head> section of your HTML, before other scripts that might access the Refgrow() function.

Step 2: Choose Your Conversion Tracking Method

Multiple Methods: You can use one or multiple tracking methods simultaneously.

Automatically track payments processed through Stripe:

  1. Go to your project's "Integration" tab
  2. Select "Stripe Webhooks" as your tracking method
  3. Enter your Stripe Secret Key (a restricted key is recommended)
  4. Click "Connect Stripe"

Refgrow will automatically set up the required webhook in your Stripe account.

For Direct Purchase Flow: If users can purchase without registering, make sure to pass the referral code to Stripe. See the Stripe guide for details.

Track purchases made through Lemonsqueezy:

  1. Go to your project's "Integration" tab
  2. Select "Lemonsqueezy Webhooks" as your tracking method
  3. Enter your Lemonsqueezy API Key
  4. In your Lemonsqueezy dashboard, create a webhook pointing to:
    https://refgrow.com/webhook/lemonsqueezy/YOUR_PROJECT_ID
  5. Select the events: order_created and subscription_created

For Lemonsqueezy checkout pages, add this parameter to your checkout URL:

?referral_code={{refgrow_ref_code}}

This will pass the cookie value to Lemonsqueezy for proper attribution.

Track conversions by calling the Refgrow() function in your code:

// Track a signup (no monetary value)
Refgrow(0, 'signup', 'user@example.com');

// Track a purchase (with monetary value)
Refgrow(49.99, 'purchase', 'user@example.com');

Parameters:

  1. value - Monetary value (use 0 for non-monetary events)
  2. type - Event type ('signup', 'purchase', or custom)
  3. email - User's email (crucial for attribution)

Place this code on thank you pages, after successful registrations, or whenever a conversion occurs.

Step 3: Add the Affiliate Dashboard

The affiliate dashboard is where users can sign up as affiliates, get their referral links, and track their earnings.

Option 1: For Websites with User Authentication

If users are already logged into your site, pass their email to pre-authenticate them:

<div id="refgrow" 
    data-project-id="YOUR_PROJECT_ID" 
    data-project-email="user@example.com"
    data-lang="ro"> <!-- Optional: Specify language code (e.g., ro, es, fr) -->
</div>
<script src="https://refgrow.com/embed.js"></script>

Notes:

  • Replace YOUR_PROJECT_ID with your actual project ID
  • Replace user@example.com with your server-side code that outputs the current user's email
  • The data-lang attribute is optional. If omitted, the language set in your project settings (or English by default) will be used. Supported codes include: en, ro, ua, de, es, fr, it, pt.
  • The user will be automatically logged in to the affiliate dashboard

Option 2: Without User Authentication

For standalone affiliate pages or sites without authentication:

<div id="refgrow" 
    data-project-id="YOUR_PROJECT_ID"
    data-lang="ro"> <!-- Optional: Specify language code -->
</div>
<script src="https://refgrow.com/embed.js"></script>

Users will need to enter their email and verify it to access their affiliate dashboard.

The data-lang attribute works the same way here.

Customizing the Dashboard

You can customize the appearance and content of the dashboard in your Refgrow project's "Design" tab, including:

  • Colors and fonts to match your brand
  • Custom titles and descriptions
  • Which stats to display
  • Payout information

Step 4: Configure Commission Settings

Set up your commission structure in your Refgrow project settings:

  1. Go to your project's "Settings" tab
  2. Configure your default commission rate (percentage or fixed amount)
  3. Set the commission duration (lifetime, first purchase, or limited period)

Advanced Commission Options

Refgrow offers advanced commission options:

  • Product-specific commissions - Set different rates for specific products
  • Affiliate-specific overrides - Create custom rates for individual affiliates

For details on setting up these advanced options, see the Commissions guide.

Testing Your Installation

Complete Test Flow

  1. Sign up as a test affiliate
  2. Generate your referral link
  3. Open the link in a new private/incognito browser window
  4. Verify the cookie is set (check your browser's developer tools)
  5. Make a test purchase or trigger a conversion
  6. Verify the conversion appears in your Refgrow dashboard

Debugging Tools

The tracking script logs helpful information to the browser console. Open your browser's developer tools (F12) to see:

  • Referral code detection
  • Cookie setting confirmation
  • Conversion tracking events

Troubleshooting

  1. Verify the tracking script is on all pages with the correct project ID
  2. Check your browser console for any error messages
  3. Ensure third-party cookies are not blocked by the browser
  4. Test with a known referral link format (e.g., ?ref=CODE)
  5. Verify the referral parameter name matches your project settings

For Stripe/Lemonsqueezy:

  • Ensure webhooks are properly configured
  • Verify you're passing the referral code to the payment provider
  • Check webhook logs in your payment provider dashboard

For Manual Tracking:

  • Ensure you're providing a valid email address to the Refgrow() function
  • Verify the cookie exists when making the call
  • Check your browser console for any API errors

  1. Verify the embed.js script is loading properly
  2. Check that the project ID is correct
  3. Ensure there are no JavaScript errors on your page
  4. Test the dashboard on a clean page without other scripts
  5. Verify that your domain is properly configured in your project settings

Next Steps

Stripe Integration

Learn advanced options for integrating with Stripe.

View Guide
Commission Settings

Configure product-specific and affiliate-specific commissions.

View Guide
Dashboard Customization

Personalize the affiliate dashboard to match your brand.

View Guide