Learn how to track lead conversion events with Appwrite and Dub
lead
event happens when a user performs an action that indicates interest in your product or service. This could be anything from:
Create an Appwrite Cloud project
sessions.write
scope enabled and save the API key for later use. You can also copy your project ID and endpoint from the project’s Settings page.Add environment variables
Integrate Dub Analytics
DubAnalytics
component from the @dub/analytics
package to your app’s root layout.Prepare the Appwrite client and auth library
Set up Dub SDK
dub.track.lead()
function.Send leads to Dub on user signup
/auth
page, use the Appwrite Admin client to allow users to sign up. Post sign up, check if the dub_id
cookie is present, send a lead event to Dub if found, and delete the dub_id
cookie.Property | Required | Description |
---|---|---|
clickId | Yes | The unique dub_id parameter that the lead conversion event is attributed to. |
eventName | Yes | The name of the event. Example: “Sign up”. |
externalId | Yes | The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer. |
customerEmail | No | The email address of the customer. If not passed, a random email address will be generated. |
customerName | No | The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”). |
customerAvatar | No | The avatar URL of the customer. If not passed, a random avatar URL will be generated. |