diff --git a/.prettierignore b/.prettierignore index 3d3da4ee..bf788e3c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,3 +8,4 @@ layouts/case-studies/immersive.html layouts/case-studies/single.html layouts/case-studies/_markup/render-link.html layouts/partials/case-study-entry.html +layouts/partials/plausible.html diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e39e62ed..70f36ee5 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -159,6 +159,8 @@ src="//static.klaviyo.com/onsite/js/klaviyo.js?company_id=TTc7Za" > --> + {{ partial "plausible.html" . }} + + +{{ end }} diff --git a/netlify.toml b/netlify.toml index d3fd5dd0..a3ec1be8 100644 --- a/netlify.toml +++ b/netlify.toml @@ -60,6 +60,23 @@ status = 301 force = true ######################################################## +######################################################## +# Plausible Analytics proxy. Serves the tracker first-party so ad blockers +# don't strip it. These MUST stay above the catch-all 404 below, and the paths +# MUST match the script src + endpoint in layouts/partials/plausible.html +[[redirects]] +from = "/mpx/js/script.js" +to = "https://plausible.io/js/pa-J584RNJ6fxr4nE6Fry8ys.js" +status = 200 +force = true + +[[redirects]] +from = "/mpx/api/event" +to = "https://plausible.io/api/event" +status = 200 +force = true +######################################################## + [[redirects]] from = "/*" to = "/404.html"