The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Add support for continent
Steven Tey577f1cfcb14d
diff --git a/apps/web/lib/tinybird/record-click.ts b/apps/web/lib/tinybird/record-click.tsindex 04e6dc9b3a..c3e5a1b800 100644--- a/apps/web/lib/tinybird/record-click.ts+++ b/apps/web/lib/tinybird/record-click.ts@@ -34,6 +34,10 @@ export async function recordClick({const geo = process.env.VERCEL === "1" ? req.geo : LOCALHOST_GEO_DATA;const ua = userAgent(req);const referer = req.headers.get("referer");++ const continent = req.headers.get("x-vercel-ip-continent");+ console.log({ continent });+const ip = process.env.VERCEL === "1" ? ipAddress(req) : LOCALHOST_IP;const identity_hash = await getIdentityHash(req);// deduplicate clicks from the same IP address + link ID – only record 1 click per hour