- 25% discount for the first 12 months
- 30% lifetime discount
- $50 one-off discount
Option 1: Direct link-based discounts (recommended)
If you’re using Stripe for payments, you can follow these steps to set up direct link-based discounts for your partner referral links:Link-based discounts provide better attribution accuracy since you get
visibility into the customer’s geolocation, device info, referrer details, and
UTM data.The trade-off here is that it requires some engineering work to set up.
1
Create a discount on Dub
First, navigate to the partner group that you want to create a discount for. Under the Discount tab, you’ll be able to create a discount for the group
If you already have a discount set up for your default group, you can just duplicate it. If not, click Create to create your first group discount:
New Stripe couponIf you don’t have a coupon set up on Stripe yet, you can use the New Stripe coupon option to create a new coupon based on the discount type (percentage vs flat), amount, and duration set in Dub.Use Stripe coupon IDIf you already have an existing coupon on Stripe, you can enter the Stripe coupon ID (should be an 8 alphanumeric code) under the Use Stripe coupon ID option.


Since Stripe doesn’t support updating coupons after creation, you’d need todelete your discount in Dub and create a new one if you want to update any of the discount parameters.Note: Deleting a discount on Dub does not delete the corresponding Stripe coupon.
2
Add coupon logic to checkout flow
The key to implementing link-based discounts is to check if a customer is eligible for a discount using Dub’s Customers API, then automatically apply the appropriate Stripe coupon to their checkout session.Here’s how the flow works:Once this is set up, eligible customers will automatically see the coupon code applied at checkout:
- When a user clicks a partner referral link, Dub tracks them as a potential customer
- During checkout, you query the Dub Customers API using the user’s ID
- If they’re eligible for a discount, you apply the coupon to their Stripe checkout session
- If not, you allow them to enter promotion codes manually

Option 2: Using Stripe promo codes (no code required)
If you prefer a no-code solution, you can set up Stripe promo-code-based discounts for your partners.Stripe promo-code-based discounts is much easier to set up (no code required).However, you do sacrifice on attribution accuracy since you won’t have any
insights into the customer’s geolocation, device info, referrer details, and
UTM data. Our Stripe integration will try to derive the customer’s location
based on their Stripe billing address, but it can sometimes be inaccurate.
1
Create a discount on Dub
First, navigate to the partner group that you want to create a discount for. Under the Discount tab, you’ll be able to create a discount for the group
If you already have a discount set up for your default group, you can just duplicate it. If not, click Create to create your first group discount:
New Stripe couponIf you don’t have a coupon set up on Stripe yet, you can use the New Stripe coupon option to create a new coupon based on the discount type (percentage vs flat), amount, and duration set in Dub.Use Stripe coupon IDIf you already have an existing coupon on Stripe, you can enter the Stripe coupon ID (should be an 8 alphanumeric code) under the Use Stripe coupon ID option.


Since Stripe doesn’t support updating coupons after creation, you’d need todelete your discount in Dub and create a new one if you want to update any of the discount parameters.Note: Deleting a discount on Dub does not delete the corresponding Stripe coupon.
2
Create your partner code
Open the partner profile that you’d like to create a discount code for, then click Create Code in the “Discount codes” section.
Here you can select which referral link you’d like to associate the code with. Then you can create the discount code.
After the code has been created, you’ll see its value populated in the Discount Code section, and it is ready for use. In the Partner Dashboard, they’ll also see the associated discount code within their partner links.


Discount codes cannot be edited after creation, so ensure that you have
everything correct before creating the code

Displaying discount banner
Once you’ve set up dual-sided incentives, a potential next step would be to display the discount information on your pricing page / landing page hero. To do that, all you need is to install the@dub/analytics script with client-side click-tracking enabled – then, when someone lands on your site via a valid referral link, the script will automatically fetch the partner and discount data for you.
This data will be stored as a JSON-stringified object in the dub_partner_data cookie in the following format:
useAnalytics() hook. If you’re working in a non-React environment, you can use the DubAnalytics object directly.
Here is a quick example of how you can display a discount banner using the useAnalytics() hook:
