Skip to content

feat: enable Google Tag Manager on cloud version only - #5083

Merged
Siumauricio merged 1 commit into
canaryfrom
feat/cloud-tag-manager
Aug 14, 2026
Merged

feat: enable Google Tag Manager on cloud version only#5083
Siumauricio merged 1 commit into
canaryfrom
feat/cloud-tag-manager

Conversation

@Siumauricio

@Siumauricio Siumauricio commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Mounts the existing Analytics component (components/shared/analytics.tsx) in _app.tsx. That component already loads Google Tag Manager (GTM-PWBFB2V2, same container used on dokploy.com) and the HubSpot script gated behind api.settings.isCloud, but it was never mounted anywhere, so it never actually ran.

Verified locally with Playwright by toggling IS_CLOUD in .env:

  • IS_CLOUD=false: no dataLayer, no GTM/HubSpot scripts injected, no requests to google.com/hubapi.com.
  • IS_CLOUD=true: GTM loads, dataLayer populates with gtm.js/gtm.dom/gtm.load, HubSpot script loads, and GTM's configured tags fire real network requests.

Greptile Summary

Mounts the existing analytics component globally so Google Tag Manager and HubSpot run only in cloud deployments.

  • Adds the shared Analytics import to the application entry point.
  • Renders analytics within the existing application provider tree.
  • Leaves self-hosted installations unaffected through the component’s server-derived cloud gate.

Confidence Score: 5/5

The PR appears safe to merge with analytics remaining disabled for self-hosted deployments.

The mounted component receives its required router and tRPC contexts, handles unresolved or failed cloud-setting queries by rendering nothing, and injects third-party scripts only when the server reports a cloud deployment.

Reviews (1): Last reviewed commit: "feat: enable Google Tag Manager on cloud..." | Re-trigger Greptile

Mounts the existing cloud-gated Analytics component (GTM + HubSpot
script loader) in _app.tsx. It was already implemented behind
api.settings.isCloud but never wired into the app, so it never loaded
on cloud or self-hosted instances.
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 14, 2026
@Siumauricio
Siumauricio merged commit d542967 into canary Aug 14, 2026
6 checks passed
@Siumauricio
Siumauricio deleted the feat/cloud-tag-manager branch August 14, 2026 14:56
@Siumauricio
Siumauricio restored the feat/cloud-tag-manager branch August 14, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant