Coupon Tracking
Attribute sales to affiliates using unique coupon codes.
Overview
Refgrow allows you to track affiliate sales not only through referral links but also via unique coupon codes. This provides an alternative or supplementary method for affiliates to drive sales and get credit for them. Coupon tracking works with Stripe, LemonSqueezy (via webhooks), and manual conversion tracking.
How Coupon Tracking Works
-
Create Coupons in Refgrow:
Navigate to your Project Dashboard -> Coupons. Here you can create coupon codes and assign them to specific affiliates. For each coupon in Refgrow, you can optionally provide:
- Stripe Coupon ID: If this coupon in Refgrow corresponds to a specific Coupon Object ID in your Stripe account (e.g.,
coup_XXXXXXXXXXXXXX
). This is used by Refgrow to match webhook events from Stripe. - LemonSqueezy Discount Code: If this coupon in Refgrow corresponds to a specific Discount Code you've created in your LemonSqueezy store. This is used by Refgrow to match webhook events from LemonSqueezy.
The main "Your Coupon Code" in Refgrow is the code your customers will typically use, and it's also used for manual tracking.
- Stripe Coupon ID: If this coupon in Refgrow corresponds to a specific Coupon Object ID in your Stripe account (e.g.,
-
Affiliate Shares Coupon:
Your affiliate shares their assigned coupon code (e.g., "AFFILIATE20") with their audience.
-
Customer Makes a Purchase:
A customer uses this coupon code during the checkout process on your website (integrated with Stripe or LemonSqueezy).
-
Conversion Attribution:
-
Via Webhooks (Stripe/LemonSqueezy):
When a purchase is completed, Stripe or LemonSqueezy sends a webhook event to Refgrow. This event usually contains information about the discount or coupon used (e.g., the Stripe Coupon ID or the LemonSqueezy Discount Code text).
Refgrow attempts to match this information with the coupons you've configured in the "Manage Coupons" section:
- For Stripe, it looks for a match with the "Stripe Coupon ID" you entered.
- For LemonSqueezy, it looks for a match with the "LemonSqueezy Discount Code" text you entered.
If a match is found and the coupon is active and assigned to an affiliate, Refgrow attributes the sale to that affiliate and calculates the commission.
Important: For reliable automatic tracking via Stripe webhooks, it's crucial to fill in the "Stripe Coupon ID" field in Refgrow with the actual Coupon Object ID from your Stripe account. For LemonSqueezy, ensure the "LemonSqueezy Discount Code" field in Refgrow matches the discount code text used in LemonSqueezy. -
Via Manual Tracking JS Call:
You can also track conversions made with a coupon manually by calling the
Refgrow()
JavaScript function. Pass the coupon code as the fourth argument:// Example: Track a $50 purchase made with coupon 'AFFILIATE20' Refgrow(50, 'purchase', 'customer@example.com', 'AFFILIATE20');
Refgrow will then look up 'AFFILIATE20' in your project's coupons and attribute the sale accordingly.
-
Via Webhooks (Stripe/LemonSqueezy):
Setting Up Coupons
- Go to your Project Dashboard.
- Navigate to the Coupons tab from the sidebar.
- Click on "Add Coupon".
-
Fill in the details:
- Assign to Affiliate: Select the affiliate this coupon belongs to.
- Your Coupon Code: The primary code customers will use (e.g., "AFFILIATE20"). This must be unique per project.
- Stripe Coupon ID (Optional): Enter the Coupon Object ID from your Stripe account (e.g.,
coup_XXXXXXXX
) if this code corresponds to a Stripe coupon. This is vital for webhook tracking with Stripe. - LemonSqueezy Discount Code (Optional): Enter the exact discount code text from your LemonSqueezy store if this code corresponds to a LemonSqueezy discount. This is vital for webhook tracking with LemonSqueezy.
- Status: Set to Active or Inactive.
- Click "Add Coupon".
You can edit or delete coupons from the same page.
Use Cases
- Influencer Marketing: Provide unique coupon codes to influencers instead of or in addition to referral links.
- Podcast/Offline Advertising: Share memorable coupon codes in audio or print media.
- Partner Promotions: Offer special discount codes to specific partners.
- Simplified Sharing: Some affiliates and customers find coupon codes easier to share and remember than long URLs.
Troubleshooting
- Coupon not tracking via Stripe Webhook: Ensure the "Stripe Coupon ID" in Refgrow exactly matches the Coupon Object ID (
coup_...
) applied to the transaction in Stripe. Check your Stripe webhook logs and Refgrow server logs for details. - Coupon not tracking via LemonSqueezy Webhook: Ensure the "LemonSqueezy Discount Code" in Refgrow exactly matches the discount code text used in the LemonSqueezy transaction and passed in the webhook. Check your LemonSqueezy webhook logs and Refgrow server logs.
- Manual coupon tracking not working: Double-check that you are passing the correct coupon code (the one defined as "Your Coupon Code" in Refgrow) to the
Refgrow()
JavaScript function.