diff --git a/scripts/test_gsc_support_content.py b/scripts/test_gsc_support_content.py index e42e6f4f..ff7ab01b 100644 --- a/scripts/test_gsc_support_content.py +++ b/scripts/test_gsc_support_content.py @@ -72,6 +72,22 @@ def test_face_support_does_not_promise_download(self): self.assertEqual(self.face.count('data-alternative="'), 2) self.assertNotIn("com.appdevelopsk.face_reaction_battle", self.face) + def test_face_alternative_outbound_uses_standard_app_slug(self): + self.assertIn( + "app_slug: a.getAttribute('data-alternative') || 'face-reaction-battle'", + self.face, + ) + self.assertIn("source_app: 'face-reaction-battle'", self.face) + self.assertIn( + "placement: a.hasAttribute('data-alternative') ? 'alternative' : 'details'", + self.face, + ) + # Keep the historical parameter temporarily for downstream consumers. + self.assertIn( + "app: a.getAttribute('data-alternative') || 'face-reaction-battle'", + self.face, + ) + def test_canonicals_unchanged(self): for slug, html in (("dog-breeds-encyclopedia", self.paw), ("face-reaction-battle", self.face)): diff --git a/support/face-reaction-battle/index.html b/support/face-reaction-battle/index.html index 672c8a4d..88a92e9f 100644 --- a/support/face-reaction-battle/index.html +++ b/support/face-reaction-battle/index.html @@ -68,7 +68,7 @@ if (!a) return; var href = a.getAttribute('href') || ''; if (/play\.google\.com/.test(href)) { - gtag('event', 'download_click', { store: 'google_play', location: 'support', app: a.getAttribute('data-alternative') || 'face-reaction-battle', placement: a.hasAttribute('data-alternative') ? 'alternative' : 'details', link_url: href }); + gtag('event', 'download_click', { store: 'google_play', location: 'support', app: a.getAttribute('data-alternative') || 'face-reaction-battle', app_slug: a.getAttribute('data-alternative') || 'face-reaction-battle', source_app: 'face-reaction-battle', placement: a.hasAttribute('data-alternative') ? 'alternative' : 'details', link_url: href }); } }, true);