Conversion tracking require a Business plan
subscription or higher.
sale
event happens when a user purchases your product or service. Examples include:
- Subscribing to a paid plan
- Usage expansion (upgrading from one plan to another)
Prerequisites
Before you get started, make sure you follow the Dub Conversions quickstart guide to get Dub Conversions set up for your links:Configure Google Tag Manager server-side tracking
If you’ve already set up the Dub GTM Server Client and Tag for lead
tracking, you can skip ahead to step
5.
1. Set up GTM Server Container
If you’ve already set up the Dub GTM Server Client and Tag for lead
tracking, you can skip this step.
- If you already have a server container set up, you can use that
- If not, create a new server container in your GTM workspace
2. Import Dub GTM Server Client Template
If you’ve already set up the Dub GTM Server Client and Tag for lead
tracking, you can skip this step.



3. Create Dub Server Client
If you’ve already set up the Dub GTM Server Client and Tag for lead
tracking, you can skip this step.


- Client Name: Dub GTM Server Client
- Priority: 0
- Request Path:
/dub/track
- Debug Logging: (optional)

Clients in GTM Server are adapters that act as bridges between the software
running on a user’s device and your server container. They receive requests
and transform them into events that can be processed by tags.
4. Import Dub GTM Server Tag Template
If you’ve already set up the Dub GTM Server Client and Tag for lead
tracking, you can skip this step.



5. Add Sales Tracking Tag
Last but not least, you’ll want to create a new GTM Server Tag using the imported template. In your GTM server container, navigate to the Tags tab and click New.

- Dub API Key: Your Dub API key (starts with
dub_
) - Event: Select “Track sale” from the dropdown
- Customer External ID:
customerExternalId
from the event data - Amount:
amount
from the event data (in cents) - Currency:
currency
from the event data (e.g., “usd”) - Event Name:
eventName
from the event data (e.g., “Purchase”) - Payment Processor:
paymentProcessor
from the event data (e.g., “stripe”) - Invoice ID: Map to the
invoiceId
from the event data (optional) - Lead Event Name: Map to the
leadEventName
from the event data (optional) - Metadata: Map to the
metadata
from the event data (optional)

- Click + to add a new trigger
- Select Custom Event as the trigger type
- Set the Event Name to match the event name from the Dub Server Client. Default is
dub_conversion
- Add a condition to filter for sales events:
- Variable: Select a variable that contains the event type
- Operator: Equals
- Value: “Purchase”
- Name the trigger “Dub Sales Event Trigger” and save it
Property | Required | Description |
---|---|---|
customerExternalId | Yes | The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer. |
amount | Yes | The amount of the sale in cents. |
paymentProcessor | No | The payment processor that processed the sale (e.g. Stripe, Shopify). Defaults to “custom”. |
eventName | No | The name of the event. Defaults to “Purchase”. |
invoiceId | No | The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID. |
currency | No | The currency of the sale. Defaults to “usd”. |
metadata | No | An object containing additional information about the sale. |
Testing your setup
You can test your GTM server setup by sending a curl request to your server URL with the appropriate query parameters:Download GTM templates
To learn more about how to track sales with Google Tag Manager, check out the following templates:Dub GTM Server Client Template
A GTM server-side client template for receiving lead and sale conversion
events from web containers
Dub GTM Server Tag Template
A GTM server-side tag template for sending lead and sale conversion events
from your GTM server container to Dub
View conversion results
And that’s it – you’re all set! You can now sit back, relax, and watch your conversion revenue grow. We provide 3 different views to help you understand your conversions:- Time-series: A time-series view of the number clicks, leads and sales.

- Funnel chart: A funnel chart view visualizing the conversion & dropoff rates across the different steps in the conversion funnel (clicks → leads → sales).

- Real-time events stream: A real-time events stream of every single conversion event that occurs across all your links in your workspace.
