Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update create-manual-commissions.ts

Steven Teyd3d4b5ead866
diff --git a/apps/web/lib/api/commissions/create-manual-commissions.ts b/apps/web/lib/api/commissions/create-manual-commissions.ts
index 53f08033b7..01a9653a8a 100644
--- a/apps/web/lib/api/commissions/create-manual-commissions.ts
+++ b/apps/web/lib/api/commissions/create-manual-commissions.ts
@@ -480,14 +480,18 @@ async function recordEvents(args: RecordEventsArgs) {
const clickId = nanoid(16);
const clickedAt = new Date(finalLeadEventDate.getTime() - 5 * 60 * 1000);
- // Record click event
+ // Record a dummy click event (start of the conversion funnel)
const clickEvent = recordClickZodSchema.parse({
timestamp: clickedAt.toISOString(),
identity_hash: targetCustomer.externalId || targetCustomer.id,
+ workspace_id: workspace.id,
click_id: clickId,
link_id: targetLink.id,
+ domain: targetLink.domain,
+ key: targetLink.key,
url: targetLink.url,
ip: "127.0.0.1",
+ country: targetCustomer.country,
continent: targetCustomer.country
? COUNTRIES_TO_CONTINENTS[targetCustomer.country.toUpperCase()] || ""
: "",