[object Object]

← back to CelebritySignatures

GA4 events: wire named conversion/engagement events (mural_order_click, signature_upload, view_signature, cta_click) via delegated ga-events.js on all pages (DTD-B verdict)

3b155de022573e7e33898f7181101c1a8b80f315 · 2026-08-04 07:25:29 -0700 · Steve Abrams

Files touched

Diff

commit 3b155de022573e7e33898f7181101c1a8b80f315
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Aug 4 07:25:29 2026 -0700

    GA4 events: wire named conversion/engagement events (mural_order_click, signature_upload, view_signature, cta_click) via delegated ga-events.js on all pages (DTD-B verdict)
---
 public/assets/ga-events.js   | 38 ++++++++++++++++++++++++++++++++++++++
 public/game.html             |  1 +
 public/index.html            |  1 +
 public/murals.html           |  1 +
 public/upload-signature.html |  1 +
 5 files changed, 42 insertions(+)

diff --git a/public/assets/ga-events.js b/public/assets/ga-events.js
new file mode 100644
index 0000000..2a866f9
--- /dev/null
+++ b/public/assets/ga-events.js
@@ -0,0 +1,38 @@
+/* GA4 intent-event instrumentation for celebsignatures.com (property G-2HEVP6TD0J).
+ * DTD-B verdict (2026-08-04): wire NAMED conversion/engagement events, not vanity metrics.
+ * Pure DELEGATED listeners in the capture phase — never touches existing page handlers,
+ * so it can't break the gallery, the mural order flow, or the upload form. No-op if gtag
+ * isn't loaded yet. Safe to drop on any page; listeners simply never match what isn't there. */
+(function () {
+  function ev(name, params) {
+    if (typeof window.gtag === 'function') window.gtag('event', name, params || {});
+  }
+  var onMurals = location.pathname.indexOf('mural') !== -1;
+
+  document.addEventListener('click', function (e) {
+    var t = e.target;
+    if (!t || !t.closest) return;
+
+    // Hero / nav CTAs (all pages)
+    var cta = t.closest('.hbtn');
+    if (cta) { ev('cta_click', { label: (cta.textContent || '').trim().slice(0, 60), href: cta.getAttribute('href') || '' }); return; }
+
+    // Signature detail open (home gallery)
+    if (t.closest('.info-chip')) { ev('view_signature', { source: 'info_chip' }); return; }
+
+    // Murals — revenue + engagement
+    if (t.closest('#payBtn'))       { ev('mural_order_click', { location: 'order_panel' }); return; }
+    if (t.closest('[data-place]'))  { ev('mural_place_on_wall'); return; }
+    if (t.closest('.roster-trig'))  { ev('mural_roster_open'); return; }
+
+    // Upload / account (contribution funnel)
+    if (t.closest('#uploadBtn')) { ev('signature_upload', { step: 'submit_click' }); return; }
+    if (t.closest('#loginBtn'))  { ev('account_login_click'); return; }
+    if (t.closest('#signupBtn')) { ev('account_signup_click'); return; }
+  }, true);
+
+  // Murals "Request a quote instead" is a form submit, not a click
+  document.addEventListener('submit', function () {
+    if (onMurals) ev('mural_quote_request');
+  }, true);
+})();
diff --git a/public/game.html b/public/game.html
index 3a13978..90d33e6 100644
--- a/public/game.html
+++ b/public/game.html
@@ -107,6 +107,7 @@
 <!-- Google Analytics 4 (G-2HEVP6TD0J) -->
 <script async src="https://www.googletagmanager.com/gtag/js?id=G-2HEVP6TD0J"></script>
 <script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-2HEVP6TD0J');</script>
+<script src="/assets/ga-events.js" defer></script>
 <link rel="canonical" href="https://celebsignatures.com/game">
 <meta name="description" content="Six games: name the artist, name the painting, spot the earlier signature, and a 5-second Lightning Round. Play free and climb the leaderboard.">
 <link rel="apple-touch-icon" href="/assets/favicon.png">
diff --git a/public/index.html b/public/index.html
index 28c0450..0951a93 100644
--- a/public/index.html
+++ b/public/index.html
@@ -239,6 +239,7 @@
 <!-- Google Analytics 4 (G-2HEVP6TD0J) -->
 <script async src="https://www.googletagmanager.com/gtag/js?id=G-2HEVP6TD0J"></script>
 <script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-2HEVP6TD0J');</script>
+<script src="/assets/ga-events.js" defer></script>
 <link rel="canonical" href="https://celebsignatures.com/">
 <meta name="description" content="Browse 7,000+ authentic signatures of history’s icons — artists, authors, presidents, founders — each traced to a real archive. Order any as a wall mural.">
 <link rel="apple-touch-icon" href="/assets/favicon.png">
diff --git a/public/murals.html b/public/murals.html
index 3235a06..f0b3bad 100644
--- a/public/murals.html
+++ b/public/murals.html
@@ -145,6 +145,7 @@
 <!-- Google Analytics 4 (G-2HEVP6TD0J) -->
 <script async src="https://www.googletagmanager.com/gtag/js?id=G-2HEVP6TD0J"></script>
 <script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-2HEVP6TD0J');</script>
+<script src="/assets/ga-events.js" defer></script>
 <link rel="canonical" href="https://celebsignatures.com/murals">
 <meta name="description" content="A wall of history in their own hand. Custom-size signature murals from $10/sq ft, printed to order.">
 <link rel="apple-touch-icon" href="/assets/favicon.png">
diff --git a/public/upload-signature.html b/public/upload-signature.html
index d51cbf2..f3ea2a2 100644
--- a/public/upload-signature.html
+++ b/public/upload-signature.html
@@ -40,6 +40,7 @@
 <!-- Google Analytics 4 (G-2HEVP6TD0J) -->
 <script async src="https://www.googletagmanager.com/gtag/js?id=G-2HEVP6TD0J"></script>
 <script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-2HEVP6TD0J');</script>
+<script src="/assets/ga-events.js" defer></script>
 <link rel="canonical" href="https://celebsignatures.com/upload">
 <meta name="description" content="Own your signature. Upload it, keep it private, and earn a commission on every download.">
 <link rel="apple-touch-icon" href="/assets/favicon.png">

← fc549c4 Stripe Checkout for mural orders (Steve APPROVED, TEST-mode)  ·  back to CelebritySignatures  ·  GA4 events: add game_start (mode/difficulty/category) + game e44e3a8 →