Google Tag Manager & Google Analytics

Drop your GTM container or GA measurement ID into Settings; the agent wires the snippet across the entire app

Overview

Track and measure your app's performance with Google Tag Manager (GTM) and Google Analytics. Tell the agent to enable tracking, paste your GTM container ID or GA measurement ID into the Settings, and the tracking snippet is injected across every page automatically.

What it supports

  • Page views — every route change is reported, including client-side navigation
  • User behaviour — session duration, scroll depth, and standard GA engagement metrics
  • Conversions — track signups, purchases, custom goals via GA events
  • Custom events — track button clicks, form submissions, or any interaction by asking the agent to fire a named event
  • GTM container — once GTM is installed, you can manage every other tag (Meta pixel, LinkedIn Insight, Mixpanel, etc.) from the GTM UI without coming back to Pentoggle

Example prompts

"Add Google Analytics tracking to my app."

"Set up Google Tag Manager so I can manage all my
tracking tags."

"Track a conversion event called 'purchase_completed'
when a user finishes checkout, with the order total as
a parameter."

Setting up GTM / GA

  1. Get your tracking ID
    • For GTM: copy your Container ID from Google Tag Manager (format: GTM-XXXXXXX)
    • For GA: copy your Measurement ID from Google Analytics → Admin → Data Streams (format: G-XXXXXXXXXX)
  2. Add it in Pentoggle
    • Open your app and go to the Settings tab
    • Find the External APIs section
    • Paste the ID into the GTM Container ID or GA Measurement ID field and click Save
  3. Verify on your live site
    • Open your live app and trigger a page view
    • Use the Tag Assistant extension to confirm the tag fires, or check the GA Realtime report

How it works

  1. The tracking ID you saved in Settings is injected into the app's HTML head on every page
  2. The GTM/GA script loads in the user's browser on the first page view and sends a page_view event to Google
  3. On every subsequent client-side navigation, Pentoggle fires another page_view with the new URL so SPA navigation is fully tracked
  4. Any custom events you asked for fire with the parameters you described (e.g., purchase_completed with order_total)
  5. GTM-managed tags (Meta pixel, Mixpanel, etc.) run inside the same container script with no further code changes

Built-in analytics (still free)

Even without GTM/GA, every published Pentoggle app comes with built-in analytics — page views, unique visitors, top pages, top referrers, and device breakdowns — at no extra cost. See Managing Your Apps. Use GA when you want deeper segmentation, custom funnels, or already have an established GA workflow.

Tip: Run both. Built-in analytics is always-on and zero-config; GA adds advanced reporting when you need it.

Limitations

  • Google-only — this integration covers GTM and GA. Other analytics tools (Plausible, PostHog, Mixpanel) can be added via GTM, or by asking the agent to add a custom script
  • Privacy / consent — GTM and GA require user consent in many jurisdictions; Pentoggle doesn't enforce a consent banner automatically. Ask the agent to add one for GDPR/CCPA compliance
  • One ID per app — you can have either GTM or GA (or both), but only one Container/Measurement ID per app. To track multiple GA properties from one app, use GTM and configure them from there
  • Server-side events — only client-side events are reported. Server-side conversion APIs are not currently wired up

Troubleshooting

  • "Realtime" in GA shows zero users — confirm the Measurement ID in Settings starts with G- (GA4) and isn't an older Universal Analytics ID. UA properties were retired by Google in 2023
  • Tag Assistant shows the tag missing — open the live app in a private window (ad blockers can suppress GA scripts) and reload; if the tag still doesn't appear, re-save the ID in Settings
  • Page views fire twice — usually means you have both a GTM container and a GA Measurement ID set, and GTM is also firing GA. Pick one or remove the duplicate GA tag from inside GTM
  • Custom event not firing — ask the agent to confirm where the event call lives in code, and use the GA DebugView to verify it reaches Google when triggered
  • Compliance concerns — ask the agent to add a consent banner that gates GTM/GA loading until the user accepts