From df60e7485497ba1685db45979d721fa4d896694e Mon Sep 17 00:00:00 2001 From: Sarthak Agrawal Date: Sat, 15 Aug 2026 23:36:44 +0530 Subject: [PATCH] feat: add PostHog page_view tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add PostHog analytics snippet to track page_view events with the product's project_id. Uses PostHog's CDN loader — no npm dependency needed for static/Astro sites. Part of fleet-workspace#348 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- biome.json | 3 ++- landing/index.html | 1 + landing/scripts/posthog.js | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 landing/scripts/posthog.js diff --git a/biome.json b/biome.json index f902478..fa4295b 100644 --- a/biome.json +++ b/biome.json @@ -12,7 +12,8 @@ "!ios", "!artifacts", "!landing/project-strip.js", - "!foundry-evidence.json" + "!foundry-evidence.json", + "!landing/scripts/posthog.js" ] }, "formatter": { "enabled": false }, diff --git a/landing/index.html b/landing/index.html index 0c38cd9..25b21cc 100644 --- a/landing/index.html +++ b/landing/index.html @@ -53,6 +53,7 @@ + diff --git a/landing/scripts/posthog.js b/landing/scripts/posthog.js new file mode 100644 index 0000000..2c54e81 --- /dev/null +++ b/landing/scripts/posthog.js @@ -0,0 +1 @@ +!function(t,e){var o,n,a,r,i;function s(e){(o=t._phq=t._phq||[]).push([].slice.call(e))}o=t.posthog=function(e,n){s([e,n])},o.__loaded||(a=e.createElement("script"),a.type="text/javascript",a.async=!0,a.crossOrigin="anonymous",a.src="https://us.i.posthog.com/array.js",r=e.getElementsByTagName("script")[0],r.parentNode.insertBefore(a,r),o.__loaded=!0),t.posthog.init("phc_qgiAarw4Co4pw9fz3Fxj4UJaHmqzFetqs4JrXhGc35Nd",{api_host:"https://us.i.posthog.com",person_profiles:"always",capture_pageview:!1,autocapture:!1,loaded:function(){t.posthog.capture("page_view",{project_id:"motion"})}})}(window,document);