From 7bd922a0128a62824a44ca6ddee8da3b00fa5296 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Thu, 12 Mar 2026 12:08:07 +0100 Subject: [PATCH] feat: add shared link referrer icon and new social platform icons Add branded icons for WhatsApp, Telegram, Snapchat, Pinterest, Threads. Add link icon for new "Shared Link" referrer category. Update changelog. --- CHANGELOG.md | 2 ++ lib/utils/icons.tsx | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba27dca..3c4f638 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ### Improved +- **Smarter referrer attribution.** Traffic that arrives without a referrer on a deep page (like a blog post) is now shown as "Shared Link" instead of "Direct." Real direct traffic — visitors who land on your homepage — still shows as "Direct." This gives you a much clearer picture of where your traffic actually comes from, since most unattributed deep-page visits are people clicking links shared in messaging apps or AI chatbots that strip the referrer header. +- **More in-app browsers detected.** Pulse now recognises visits from WhatsApp, Telegram, Snapchat, Pinterest, Reddit, and Threads in-app browsers and attributes them correctly instead of lumping them into "Direct." - **Dashboard blocks are now consistent in height.** The Goals & Events and Scroll Depth panels now match the height of every other block on the dashboard. - **Cleaner period picker.** The date range dropdown now has visual separators between the rolling windows (Today, Last 7 days, Last 30 days), the calendar periods (This week, This month), and Custom — so it's easy to tell them apart at a glance. - **New date range options.** The period selector now includes "This week" (Monday to today) and "This month" (1st to today) alongside the existing rolling windows. Your selection is remembered between sessions. diff --git a/lib/utils/icons.tsx b/lib/utils/icons.tsx index 2b45fec..bd31f15 100644 --- a/lib/utils/icons.tsx +++ b/lib/utils/icons.tsx @@ -18,6 +18,12 @@ import { YoutubeLogo, RedditLogo, Robot, + Link, + WhatsappLogo, + TelegramLogo, + SnapchatLogo, + PinterestLogo, + ThreadsLogo, } from '@phosphor-icons/react' /** @@ -63,6 +69,11 @@ export function getReferrerIcon(referrerName: string) { if (lower.includes('github')) return if (lower.includes('youtube')) return if (lower.includes('reddit')) return + if (lower.includes('whatsapp')) return + if (lower.includes('telegram')) return + if (lower.includes('snapchat')) return + if (lower.includes('pinterest')) return + if (lower.includes('threads')) return // AI assistants and search tools if (lower.includes('chatgpt') || lower.includes('openai')) return if (lower.includes('perplexity')) return @@ -73,11 +84,13 @@ export function getReferrerIcon(referrerName: string) { if (lower.includes('grok') || lower.includes('x.ai')) return if (lower.includes('phind')) return if (lower.includes('you.com')) return + // Shared Link (unattributed deep-page traffic) + if (lower === 'shared link') return return } -const REFERRER_NO_FAVICON = ['direct', 'unknown', ''] +const REFERRER_NO_FAVICON = ['direct', 'shared link', 'unknown', ''] /** Common subdomains to skip when deriving the main label (e.g. l.instagram.com → instagram). */ const REFERRER_SUBDOMAIN_SKIP = new Set([ @@ -100,6 +113,7 @@ const REFERRER_DISPLAY_OVERRIDES: Record = { telegram: 'Telegram', pinterest: 'Pinterest', snapchat: 'Snapchat', + threads: 'Threads', tumblr: 'Tumblr', quora: 'Quora', 't.co': 'X',