Ad blockers don't just block ads — they block analytics too. Most blocklists target known analytics domains (including Application Insights endpoints like js.monitor.azure.com and *.in.applicationinsights.azure.com), which means site owners lose visibility into real traffic patterns. For a personal blog, this can mean 30-40% of visits go untracked.
Instead of sending telemetry directly to App Insights endpoints (which get blocked), route it through a first-party path. Since the requests go to your own domain, ad blockers have no reason to block them.
The proxy receives telemetry from the browser, forwards it to App Insights, and returns the response. From the browser's perspective, it's just talking to your own domain.
analytics.alexjohnson.aiPros: Full control over the runtime, can use C#/.NET, works for any site regardless of hosting platform.
Cons: Extra infrastructure (Container Apps resource, custom domain, TLS cert, container registry, separate deployment pipeline). Overkill when simpler options exist.
Cost: ~$0-2/mo (Container Apps consumption scales to zero, GHCR is free).
/api folder to the repo — deployed automatically alongside the static sitehttps://alexjohnson.ai/api/t — already first-party, no extra subdomainPros: Zero additional infrastructure. Deploys with the site. Already first-party by default. Free on SWA Free tier. Single repo, single pipeline.
Cons: Limited to languages SWA supports for managed functions (Node.js, Python, .NET, Java). Less control over the runtime environment.
Cost: $0 (included in SWA Free tier).
For a personal blog already on Azure Static Web Apps, the managed function approach is the obvious choice. There's no reason to stand up a separate Container Apps resource, container registry, and deployment pipeline when SWA gives you a serverless function for free. The proxy endpoint is inherently first-party (same domain), so no custom subdomain or extra DNS setup is needed.
Option A makes more sense if you're hosting on a platform without built-in serverless functions, or if you need C#/.NET specifically, or if you want the proxy to serve multiple sites.
A third design decision alongside the proxy approach: do you self-host the full App Insights SDK or write a lightweight custom client?
src and endpoint URLtrackPageView() oncePerformanceNavigationTiming, document.title, location.href) to collect page views and performance metrics/api/tbaseType entries to the same envelopeThe custom client is the better fit here. Shipping 36KB to call one endpoint goes against the site's minimal-JS philosophy. The browser already exposes everything we need — page load timing, TTFB, DNS lookup, DOM processing — through the Performance API.
This isn't about sneaking tracking past ad blockers — it's about getting accurate page view counts while respecting privacy:
The proxy is transparent — it doesn't add any tracking beyond what the original SDK collected. It just ensures the requests actually reach the endpoint, and the custom client ensures the code actually runs.