Learn how to set up your referral/affiliate program with Dub Partners.
@dub/analytics
client-side SDK@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.
?via=john
)@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 page/track/click
request in your browser’s Network tab (and no errors in the Console tab).dub_id
cookie is being set upon a successful /track/click
request.localhost
to the Allowed
Hostnames list temporarily. This will allow local events to be ingested by
Dub. Don’t forget to remove it once you’re ready to go live!lead
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: