From 7e6baa968bfba5f128021fb9ba3d77e2727c8c0c Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Wed, 21 Oct 2026 08:16:20 +0800 Subject: [PATCH] feat(website): send a GA4 event on sponsorship email clicks Mailto clicks on the sponsorship page leave no page view, so the sponsor funnel ended at the sponsorship page and never showed who went on to email. Each click now sends a sponsor_contact event with a short tier value (headline, featured, indie, or general) rather than the link URL, since GA4 caps event parameter values at 100 characters and the Indie Dev mailto href is 101. Co-Authored-By: Claude --- website/static/main.js | 7 +++++++ website/templates/sponsorship.html | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/website/static/main.js b/website/static/main.js index 72dd4e0f..8ca095ba 100644 --- a/website/static/main.js +++ b/website/static/main.js @@ -399,6 +399,13 @@ document.addEventListener("click", function (e) { } }); +// Mailto clicks leave no page view, so the sponsor funnel needs its own event +document.addEventListener("click", function (e) { + const link = e.target.closest('a[href^="mailto:sponsorship@"]'); + if (!link || typeof gtag !== "function") return; + gtag("event", "sponsor_contact", { tier: link.dataset.tier }); +}); + if (location.hash) { const linkedRow = document.getElementById(decodeURIComponent(location.hash.slice(1))); if (linkedRow && linkedRow.matches("tr.row")) openEntryRow(linkedRow); diff --git a/website/templates/sponsorship.html b/website/templates/sponsorship.html index 34de3517..2c7de2fc 100644 --- a/website/templates/sponsorship.html +++ b/website/templates/sponsorship.html @@ -45,6 +45,7 @@
Email sponsorship@awesome-python.com @@ -128,6 +129,7 @@ Email about Headline tier @@ -151,6 +153,7 @@ Email about Featured tier @@ -180,6 +183,7 @@ Email about Indie Dev tier @@ -225,6 +229,7 @@ Email sponsorship@awesome-python.com with the four items below. @@ -261,6 +266,7 @@