How to add the @dub/analytics client-side script to your React website
@dub/analytics
to your project.<Analytics />
component to track conversions on your website.E.g. if you’re using Next.js, you can add the <Analytics />
component to your root layout component or any other pages where you want to track conversions.domainsConfig.refer
property to enable client-side click-tracking._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<Analytics />
component to customize its behavior:
first-click
: The first click model
gives all the credit to the first touchpoint in the customer journey.last-click
: The last click model gives all the credit to the last
touchpoint in the customer journey.?via=abc123
).