Learn how to track conversion analytics with Dub.
@dub/analytics
client-side SDKOption 1: On a workspace-level
Option 2: On a link-level
C
keyboard shortcut when inside the link builder to
quickly enable conversion tracking for a given link.Option 3: Via the API
trackConversion: true
when creating or updating a link:@dub/analytics
client-side SDKdub_id
query parameter and storing it as a first-party cookie, which will be used to attribute subsequent conversion events to the original link.
@dub/analytics
script in several different ways:
_dubAnalytics
– if the script is installed correctly, you should see the _dubAnalytics
object in the console.?dub_id=test
query parameter to your website URL and make sure that the dub_id
cookie is being set in your browser.<head>
section of the pagelead
event. This happens when a user performs an action that indicates interest in your product or service. This could be anything from:
Sign Up
, which happens when a user signs up for an account. Depending on which authentication framework you’re using, here are a few examples of how to send Sign Up
lead events:
The lead event will serve as the source of truth for the customer’s identity and which link they came from. This means that all subsequent actions performed by the customer (e.g. upgrading their plan, purchasing a product) will automatically be attributed to the original link.
To learn more about tracking lead events with Dub, refer to the following resources:
sale
event. This happens when a user purchases your product or service. This could be anything from:
POST /track/sale
API endpoint.
To learn more about tracking sale events with Dub, refer to the following resources: