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.

Fix tb implementation

Steven Teye2c7d28f03a3
diff --git a/apps/web/lib/tinybird.ts b/apps/web/lib/tinybird.ts
index be120cb8b9..8180b4b37c 100644
--- a/apps/web/lib/tinybird.ts
+++ b/apps/web/lib/tinybird.ts
@@ -63,7 +63,9 @@ export async function recordClick({
alias_link_id: "",
url: url || "",
ip:
- ip &&
+ // only record IP if it's a valid IP and not from EU
+ typeof ip === "string" &&
+ ip.trim().length > 0 &&
(!geo?.country ||
(geo?.country && !EU_COUNTRY_CODES.includes(geo.country)))
? ip