From 042dd4ca88535431099eb00f9341e39390417ac6 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:04:01 +0900 Subject: [PATCH 1/9] growth: unify press store outbound click with download_click GA4 event --- press/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/press/index.html b/press/index.html index 726afb61..1953df60 100644 --- a/press/index.html +++ b/press/index.html @@ -45,6 +45,18 @@ locale:document.documentElement.lang, placement:'press_kit' }); + // Match the site's shared outbound-store event without counting detail clicks as downloads. + if(a.getAttribute('data-cta')==='store'){ + gtag('event','download_click',{ + store:'google_play', + location:'press', + placement:'press_kit_card', + app_slug:a.getAttribute('data-app-slug')||'', + app_package:a.getAttribute('data-app-package')||'', + locale:document.documentElement.lang, + source:'press_kit' + }); + } },true); From 40153ec000591528951148dc881521814855a772 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:04:05 +0900 Subject: [PATCH 2/9] growth: unify press store outbound click with download_click GA4 event --- press/es/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/press/es/index.html b/press/es/index.html index 64de2638..004e5910 100644 --- a/press/es/index.html +++ b/press/es/index.html @@ -45,6 +45,18 @@ locale:document.documentElement.lang, placement:'press_kit' }); + // Match the site's shared outbound-store event without counting detail clicks as downloads. + if(a.getAttribute('data-cta')==='store'){ + gtag('event','download_click',{ + store:'google_play', + location:'press', + placement:'press_kit_card', + app_slug:a.getAttribute('data-app-slug')||'', + app_package:a.getAttribute('data-app-package')||'', + locale:document.documentElement.lang, + source:'press_kit' + }); + } },true); From bc5f40a2ed972ff95c1e7bc45421aca5543a1b3f Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:04:08 +0900 Subject: [PATCH 3/9] growth: unify press store outbound click with download_click GA4 event --- press/pt-br/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/press/pt-br/index.html b/press/pt-br/index.html index 3e4ec559..4c01f4c3 100644 --- a/press/pt-br/index.html +++ b/press/pt-br/index.html @@ -45,6 +45,18 @@ locale:document.documentElement.lang, placement:'press_kit' }); + // Match the site's shared outbound-store event without counting detail clicks as downloads. + if(a.getAttribute('data-cta')==='store'){ + gtag('event','download_click',{ + store:'google_play', + location:'press', + placement:'press_kit_card', + app_slug:a.getAttribute('data-app-slug')||'', + app_package:a.getAttribute('data-app-package')||'', + locale:document.documentElement.lang, + source:'press_kit' + }); + } },true); From 43368a957fe6cbcf27e3a34c8f3dee2719439d17 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:04:11 +0900 Subject: [PATCH 4/9] growth: unify press store outbound click with download_click GA4 event --- press/ja/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/press/ja/index.html b/press/ja/index.html index 60668644..0ffcdaf4 100644 --- a/press/ja/index.html +++ b/press/ja/index.html @@ -45,6 +45,18 @@ locale:document.documentElement.lang, placement:'press_kit' }); + // Match the site's shared outbound-store event without counting detail clicks as downloads. + if(a.getAttribute('data-cta')==='store'){ + gtag('event','download_click',{ + store:'google_play', + location:'press', + placement:'press_kit_card', + app_slug:a.getAttribute('data-app-slug')||'', + app_package:a.getAttribute('data-app-package')||'', + locale:document.documentElement.lang, + source:'press_kit' + }); + } },true); From 5e9e3b941a455a2662f0cc936b8149beeca76bb7 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:04:14 +0900 Subject: [PATCH 5/9] growth: unify press store outbound click with download_click GA4 event --- press/id/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/press/id/index.html b/press/id/index.html index 5136def0..ea9b9ca3 100644 --- a/press/id/index.html +++ b/press/id/index.html @@ -45,6 +45,18 @@ locale:document.documentElement.lang, placement:'press_kit' }); + // Match the site's shared outbound-store event without counting detail clicks as downloads. + if(a.getAttribute('data-cta')==='store'){ + gtag('event','download_click',{ + store:'google_play', + location:'press', + placement:'press_kit_card', + app_slug:a.getAttribute('data-app-slug')||'', + app_package:a.getAttribute('data-app-package')||'', + locale:document.documentElement.lang, + source:'press_kit' + }); + } },true); From d74c5e778ffa79248fcebffd4cf75e152d1bd8f2 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:04:39 +0900 Subject: [PATCH 6/9] test: protect 5-language press store events from duplicate or detail-click conversions --- scripts/test_press_store_events.cjs | 73 +++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 scripts/test_press_store_events.cjs diff --git a/scripts/test_press_store_events.cjs b/scripts/test_press_store_events.cjs new file mode 100644 index 00000000..0be7fa37 --- /dev/null +++ b/scripts/test_press_store_events.cjs @@ -0,0 +1,73 @@ +'use strict'; +// Offline browser-style contract for five localized press/creator pages. +// Run: node --test scripts/test_press_store_events.cjs +const test = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const vm = require('node:vm'); + +const PAGES = { + en: 'press/index.html', + es: 'press/es/index.html', + 'pt-BR': 'press/pt-br/index.html', + ja: 'press/ja/index.html', + id: 'press/id/index.html', +}; + +function exercise(locale, cta) { + const html = fs.readFileSync(path.join(__dirname, '..', PAGES[locale]), 'utf8'); + const scripts = [...html.matchAll(/]*)>([\s\S]*?)<\/script>/g)].map(m => m[1]); + const handlers = scripts.filter(s => s.includes("'press_app_click'")); + assert.equal(handlers.length, 1, 'one press click handler per locale'); + let onClick = null; + const document = { + documentElement: { lang: locale }, + addEventListener(event, callback, capture) { + assert.equal(event, 'click'); + assert.equal(capture, true); + onClick = callback; + }, + }; + const context = { document, Date }; + context.window = context; + vm.runInNewContext(handlers[0], context); + assert.equal(typeof onClick, 'function'); + const values = { + 'data-app-slug': 'blur', + 'data-app-package': 'com.blurapp.blur_app', + 'data-cta': cta, + }; + const anchor = { getAttribute: key => values[key] ?? null }; + onClick({ target: { closest: selector => { + assert.equal(selector, 'a[data-cta]'); + return anchor; + } } }); + return context.dataLayer + .filter(row => row[0] === 'event') + .map(row => ({ name: row[1], payload: JSON.parse(JSON.stringify(row[2])) })); +} + +for (const locale of Object.keys(PAGES)) { + test(locale + ': store click yields press event plus one unified outbound event', () => { + const events = exercise(locale, 'store'); + assert.deepEqual(events.map(x => x.name), ['press_app_click', 'download_click']); + assert.equal(events[0].payload.destination, 'store'); + assert.equal(events[0].payload.locale, locale); + assert.equal(events[1].payload.store, 'google_play'); + assert.equal(events[1].payload.location, 'press'); + assert.equal(events[1].payload.placement, 'press_kit_card'); + assert.equal(events[1].payload.source, 'press_kit'); + assert.equal(events[1].payload.locale, locale); + assert.equal(events[1].payload.app_slug, 'blur'); + assert.equal(events[1].payload.app_package, 'com.blurapp.blur_app'); + assert.equal(JSON.stringify(events).includes('link_url'), false); + assert.equal(JSON.stringify(events).includes('query'), false); + }); + + test(locale + ': app detail click never fires a Play store event', () => { + const events = exercise(locale, 'details'); + assert.deepEqual(events.map(x => x.name), ['press_app_click']); + assert.equal(events[0].payload.destination, 'details'); + }); +} From 1ea1e00024627242d02f9b6b56aaa7c9490ae594 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:04:47 +0900 Subject: [PATCH 7/9] test: every press locale includes unified store click contract --- scripts/test_press_kit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/test_press_kit.py b/scripts/test_press_kit.py index f4adc805..0c2afc26 100644 --- a/scripts/test_press_kit.py +++ b/scripts/test_press_kit.py @@ -57,6 +57,8 @@ def test_all_locales_and_store_destinations(self): self.assertIn("/apps", anchors) self.assertNotIn("utm_source=presskit", html, "Internal UTMs would reset acquisition attribution") self.assertIn("press_app_click", html) + self.assertIn("'download_click'", html) + self.assertIn("source:'press_kit'", html) self.assertEqual(sum(x.get("data-cta")=="store" for tag,x in doc.attrs if tag=="a"), 5) self.assertEqual(sum(tag=="a" and attrs.get("lang") in PAGES for tag,attrs in doc.attrs), len(PAGES)) From 2b61107a27165427236e3001ec85a3c185f90f7a Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:05:58 +0900 Subject: [PATCH 8/9] growth: require unified download_click on every live press locale --- scripts/check_app_discovery_live.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/check_app_discovery_live.sh b/scripts/check_app_discovery_live.sh index a77550dd..b04ce007 100644 --- a/scripts/check_app_discovery_live.sh +++ b/scripts/check_app_discovery_live.sh @@ -90,6 +90,7 @@ for entry in 'en:press/:en' 'es:press/es/:es' 'pt-br:press/pt-br/:pt-BR' 'ja:pre grep -Fq "" "$tmp/press-$code.html" || { echo "FAIL press $code language not live" >&2; exit 1; } grep -Fq "https://appdevelopsk.com/$route" "$tmp/press-$code.html" || { echo "FAIL press $code canonical not live" >&2; exit 1; } grep -Fq 'press_app_click' "$tmp/press-$code.html" || { echo "FAIL press $code app attribution missing" >&2; exit 1; } + grep -Fq "'download_click'" "$tmp/press-$code.html" || { echo "FAIL press $code unified store click attribution missing" >&2; exit 1; } done fetch '/support/face-reaction-battle/' 'face-battle.html' grep -Fq 'data-alternative="instant-judge"' "$tmp/face-battle.html" || { echo 'FAIL unavailable game alternative CTA missing' >&2; exit 1; } From 83a8c80c4613d728b2f4b4496127d4fa377d57f2 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:06:10 +0900 Subject: [PATCH 9/9] docs: distinguish press Play handoffs from actual downloads and GA4 validation --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 2b160bf6..e2fe741c 100644 --- a/README.md +++ b/README.md @@ -147,3 +147,27 @@ the JSON file and hosting/VPS release logs before changing redirects or DNS. An HTTP failure reported in this tool is an observation from the machine running it, not definitive proof the origin is offline to every user. This script makes no publishing, cache-purge, tracking or DNS changes. + + +## Press-to-store GA4 event unification (2026-11-13) + +All five press locales retain the original `press_app_click` event for both +app detail links and Play outbound links. A *real Play click* now additionally +fires the website-wide `download_click` event with allowlisted event data: +store=google_play, location=press, placement=press_kit_card, source=press_kit, +app_slug, app_package, locale. A detail-page click does **not** emit +`download_click`. These represent outbound links **not installs**. No +raw search terms, URLs, private user data or unique identifiers are sent. + +Run source tests: + +```bash +node --test scripts/test_press_store_events.cjs +python3 -m unittest scripts.test_press_kit -v +``` + +Following an authorized VPS publish, the existing live smoke now requires +unified press click source on each of the five routes. Use GA4 DebugView to +verify one `press_app_click` per real press link click and one +`download_click` per *Play* click, without counting app detail clicks +as installs. Store acquired users must be verified separately in Play Console.