The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
backwards compatibility
Kiran Kc8669b564876
diff --git a/apps/web/lib/middleware/link.ts b/apps/web/lib/middleware/link.tsindex cabc2016d6..ce67f27718 100644--- a/apps/web/lib/middleware/link.ts+++ b/apps/web/lib/middleware/link.ts@@ -232,7 +232,9 @@ export default async function LinkMiddleware(const cookieStore = cookies();let clickId = cookieStore.get("dub_id")?.value;- if (!clickId && !isPartnerLink) {++ // TODO: once the migration to new format is done (?via=key), add !isPartnerLink+ if (!clickId) {// if trackConversion is enabled, check if clickId is cached in Redisif (trackConversion) {const ip = process.env.VERCEL === "1" ? ipAddress(req) : LOCALHOST_IP;@@ -280,9 +282,9 @@ export default async function LinkMiddleware(// we only pass the clickId if:// - trackConversion is enabled- // - not a partner link+ // - not a partner link (TODO: add this later) !isPartnerLink// - there is a clickId- const shouldPassClickId = trackConversion && !isPartnerLink && clickId;+ const shouldPassClickId = trackConversion && clickId;// rewrite to proxy page (/proxy/[domain]/[key]) if it's a bot and proxy is enabledif (isBot && proxy) {