mirror of
https://github.com/vinta/awesome-python.git
synced 2026-11-08 02:15:12 -06:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
<div class="hero-actions">
|
||||
<a
|
||||
href="mailto:sponsorship@awesome-python.com?subject=Awesome%20Python%20Sponsorship"
|
||||
data-tier="general"
|
||||
class="hero-action hero-action-primary"
|
||||
>Email sponsorship@awesome-python.com</a
|
||||
>
|
||||
@@ -128,6 +129,7 @@
|
||||
</ul>
|
||||
<a
|
||||
href="mailto:sponsorship@awesome-python.com?subject=Awesome%20Python%20Sponsorship%20-%20Headline%20Tier"
|
||||
data-tier="headline"
|
||||
class="tier-cta"
|
||||
>Email about Headline tier</a
|
||||
>
|
||||
@@ -151,6 +153,7 @@
|
||||
</ul>
|
||||
<a
|
||||
href="mailto:sponsorship@awesome-python.com?subject=Awesome%20Python%20Sponsorship%20-%20Featured%20Tier"
|
||||
data-tier="featured"
|
||||
class="tier-cta"
|
||||
>Email about Featured tier</a
|
||||
>
|
||||
@@ -180,6 +183,7 @@
|
||||
</ul>
|
||||
<a
|
||||
href="mailto:sponsorship@awesome-python.com?subject=Awesome%20Python%20Sponsorship%20-%20Indie%20Dev%20Tier"
|
||||
data-tier="indie"
|
||||
class="tier-cta"
|
||||
>Email about Indie Dev tier</a
|
||||
>
|
||||
@@ -225,6 +229,7 @@
|
||||
Email
|
||||
<a
|
||||
href="mailto:sponsorship@awesome-python.com?subject=Awesome%20Python%20Sponsorship"
|
||||
data-tier="general"
|
||||
>sponsorship@awesome-python.com</a
|
||||
>
|
||||
with the four items below.
|
||||
@@ -261,6 +266,7 @@
|
||||
<div class="sponsorship-cta-row">
|
||||
<a
|
||||
href="mailto:sponsorship@awesome-python.com?subject=Awesome%20Python%20Sponsorship"
|
||||
data-tier="general"
|
||||
class="hero-action hero-action-primary"
|
||||
>Email sponsorship@awesome-python.com</a
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user