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.

small updates

Steven Tey3a8aedff5041
diff --git a/apps/web/lib/middleware/utils/bots-list.ts b/apps/web/lib/middleware/utils/bots-list.ts
index bd868b4a05..7d8aa649aa 100644
--- a/apps/web/lib/middleware/utils/bots-list.ts
+++ b/apps/web/lib/middleware/utils/bots-list.ts
@@ -46,6 +46,11 @@ export const UA_BOTS = [
"perplexity", // Perplexity AI
"Omigili", // Omigili
"timpi", // Timpi.io
+
+ // more bots detected by Vercel
+ "node", // node-fetch/1.0 (+https://github.com/bitinn/node-fetch)
+ "ShortLinkTranslate",
+ "okhttp",
];
export const IP_BOTS = [
@@ -90,12 +95,19 @@ export const IP_BOTS = [
"35.185.193.22", // The Dalles
"34.105.67.76", // The Dalles
"154.28.229.7", // Ashburn
+
+ "207.46.13.111", // microsoft IP
];
export const IP_RANGES_BOTS = [
- "159.148.128.0/24", // weird bot activity from Miami
+ // weird bot activity from Miami
+ "159.148.128.0/24",
// Expanse (Palo Alto Networks)
"198.235.24.0/24",
"205.210.31.0/24",
+
+ // odd traffic from Hong Kong (Aliexpress)
+ "47.238.13.0/24",
+ "47.238.14.0/24",
];
diff --git a/apps/web/ui/analytics/analytics-provider.tsx b/apps/web/ui/analytics/analytics-provider.tsx
index 7fc2806edd..5d3d8e8d72 100644
--- a/apps/web/ui/analytics/analytics-provider.tsx
+++ b/apps/web/ui/analytics/analytics-provider.tsx
@@ -94,7 +94,7 @@ export default function AnalyticsProvider({
}>) {
const searchParams = useSearchParams();
const pathname = usePathname();
- const { id: workspaceId, slug } = useWorkspace();
+ const { id: workspaceId, slug, domains } = useWorkspace();
const [requiresUpgrade, setRequiresUpgrade] = useState(false);
@@ -233,6 +233,26 @@ export default function AnalyticsProvider({
selectedTab,
]);
+ /*
+ If explicitly set, use the value
+ If not set:
+ - Show root domain links if:
+ - it's filtered by a link, or
+ - the workspace has more than 50 domains
+ - is admin page
+ - is filtered by a folder or tag
+ - Otherwise, hide root domain links
+ */
+ const root = searchParams.get("root")
+ ? searchParams.get("root") === "true"
+ : (domain && key) ||
+ (domains && domains.length > 50) ||
+ adminPage ||
+ folderId ||
+ tagIds
+ ? undefined
+ : "false";
+
const queryString = useMemo(() => {
const availableFilterParams = VALID_ANALYTICS_FILTERS.reduce(
(acc, filter) => ({
@@ -252,6 +272,7 @@ export default function AnalyticsProvider({
end && { start: start.toISOString(), end: end.toISOString() }),
...(interval && { interval }),
...(tagIds && { tagIds }),
+ ...(root && { root: root.toString() }),
event: selectedTab,
...(folderId && { folderId }),
...(customerId && { customerId }),
@@ -265,6 +286,7 @@ export default function AnalyticsProvider({
start,
end,
tagIds,
+ root,
selectedTab,
folderId,
customerId,
diff --git a/apps/web/ui/analytics/events/events-table.tsx b/apps/web/ui/analytics/events/events-table.tsx
index 5ace96cff3..dc1979b58e 100644
--- a/apps/web/ui/analytics/events/events-table.tsx
+++ b/apps/web/ui/analytics/events/events-table.tsx
@@ -113,7 +113,7 @@ export default function EventsTable({
id: "saleAmount",
header: "Amount",
accessorKey: "sale.amount",
- size: 120,
+ size: 160,
cell: ({ getValue }) => (
<div className="flex items-center gap-2">
<span>