Skip to content

Add GA4 event tagging across the atlas#242

Merged
planemad merged 1 commit into
mainfrom
analytics-tagging
Jul 11, 2026
Merged

Add GA4 event tagging across the atlas#242
planemad merged 1 commit into
mainfrom
analytics-tagging

Conversation

@marlonrodrigues

Copy link
Copy Markdown
Collaborator

Summary

  • New js/analytics.js: single gtag entry point with safe trackEvent() wrapper (console-logs on localhost, debug_mode on /dev paths)
  • GA4 base tag now on all 14 HTML entry points (was index.html only)
  • Custom events: layer_toggle, search_select, feature_inspect, map_export, geolocate, measure_use, terrain_3d_toggle, atlas_load, permalink_resolve, share_action
  • Privacy policy updated to disclose interaction events; cadastral search selections are recorded by type only, never plot identifiers
  • docs/analytics-plan.md: taxonomy, GA4 console setup, verification

Testing Strategy

Will review on GA once code is running

Live preview: https://amche.in/dev/

- New js/analytics.js: single gtag entry point with safe trackEvent()
  wrapper (console-logs on localhost, debug_mode on /dev paths)
- GA4 base tag now on all 14 HTML entry points (was index.html only)
- Custom events: layer_toggle, search_select, feature_inspect,
  map_export, geolocate, measure_use, terrain_3d_toggle, atlas_load,
  permalink_resolve, share_action
- Privacy policy updated to disclose interaction events; cadastral
  search selections are recorded by type only, never plot identifiers
- docs/analytics-plan.md: taxonomy, GA4 console setup, verification
@marlonrodrigues marlonrodrigues requested a review from planemad July 11, 2026 10:01
@codesandbox

codesandbox Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@marlonrodrigues marlonrodrigues self-assigned this Jul 11, 2026
@marlonrodrigues marlonrodrigues added the enhancement New feature or request label Jul 11, 2026
@planemad

planemad commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Related issue: #15

@planemad planemad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marlonrodrigues fantastic, and thank you for updating the privacy policy for transparency 💯

Overall, I'm not a big fan of forcing additional data collection on users without a plan on how to use the data, but thats a chicken and egg problem. Let's try this out for a time boxed period (6 months?) to see what we can find and later evaluate if we should keep tracking turned on or turn off by default.

@planemad planemad merged commit 46d6f3d into main Jul 11, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants