Skip to content

feat(common): Google Analytics - #496

Merged
w-le merged 2 commits into
custom/HIO687ASfrom
feat/HIO687AS-google-analytics
Sep 20, 2026
Merged

w-le merged 2 commits into
custom/HIO687ASfrom
feat/HIO687AS-google-analytics

Conversation

@w-le

@w-le w-le commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

these changes were made with opencode using Big Pickle free model

What

Adds GA4 tracking to the workplace and concierge apps.

  • libs/common/.../google-analytics.service.ts — support GA4 measurement IDs (G-…): load gtag/js, queue config (auto-fires initial page_view), emit page_view / screen_view / event / timing_complete as gtag commands. Existing GTM (GTM-…) behaviour unchanged.
  • libs/common/.../placeos.service.ts — subscribe to router NavigationEnd and push a page_view per route change (event.urlAfterRedirects).
  • apps/workplace + apps/concierge — set analytics.tracking_id to the deployment's GA4 measurement ID in the builds.
  • apps/concierge/settings.schema.json + docs/settings/concierge.md — document the new analytics.* settings.

Why

Track how end users navigate the workplace and concierge apps.

Verification

  • Nx test common: 366/366 pass (incl. 7 new service tests).
  • Headless Chrome against the served app in mock mode: gtag.js loads, window.gtag defined, /g/collect beacons fire on boot and on in-app navigation; page_view commands with page_path/page_location land in dataLayer.

Notes

  • Analysts must enable "Enhanced Measurement" page-view tracking on the GA4 property for the auto config page_view.
  • Pre-existing (not from this change): workplace prod build exceeds its bundle budget (2.11 MB vs 2.10 MB).

@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
frontend-templates Ignored Ignored Preview Sep 19, 2026 2:26am UTC

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@w-le w-le self-assigned this Sep 18, 2026
@w-le
w-le requested a review from MrYuion September 18, 2026 10:39
@w-le w-le changed the title feat(common): track route navigation with Google Analytics 4 (HIO687AS) feat(common): Google Analytics Sep 18, 2026

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@MrYuion

MrYuion commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

All looks good. Can you turn off “Page changes based on browser history events” to prevent duplicate views in the GA settings.

@w-le

w-le commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

All looks good. Can you turn off “Page changes based on browser history events” to prevent duplicate views in the GA settings.

Cool done (in g analytics admin web page)

Thanks for the review and changes, squash merging now

@w-le
w-le merged commit f4a5e98 into custom/HIO687AS Sep 20, 2026
38 of 41 checks passed
@w-le
w-le deleted the feat/HIO687AS-google-analytics branch September 20, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants