Home / Documentation / GA4 and GTM analytics
TMB Bot Guard

GA4 and GTM analytics

Configure privacy-aware security events and verify that they reach the intended analytics destination.

What Bot Guard sends

Bot Guard can send bot_detected and bot_blocked events so automated activity can be compared with ordinary traffic. Depending on the event, parameters can include the security action, anonymized address information, strike count, time, and affected page. Raw visitor IP addresses are not sent to GA4.

Choose a connection

ModeUse it when
Use Existing Site SetupThe site already loads GA4 or GTM. Bot Guard pushes its event into the existing data layer and avoids loading a second analytics setup.
Custom GA4/GTM ConfigurationYou intentionally want a separate GA4 Measurement ID or GTM container for security reporting.
Data layer onlyYou use Custom mode but leave the optional IDs blank because an existing GTM rule consumes the Bot Guard data-layer event.

Configure the existing-site mode

  1. Enable Google Analytics Tracking.
  2. Select Use Existing Site Setup (Automatic).
  3. Save changes.
  4. Open Testing Tools and confirm the reported setup.
  5. Select Test GA4 Event and verify it in GA4 DebugView or GTM Preview.

Configure a custom destination

  1. Select Custom GA4/GTM Configuration.
  2. Enter a valid G-XXXXXXXXXX Measurement ID, a GTM-XXXXXXX container, or the specific combination your analytics design requires.
  3. Save and reload the Settings screen to confirm the values remain.
  4. Send a test event.
  5. Verify the destination before relying on production reports.
Example: compare bot activity by landing pageIn GA4 Explorations, filter event name to bot_detected and use page location as a dimension. Compare those pages with ordinary sessions to identify content receiving disproportionate automated traffic.

What a successful test proves

A successful plugin response proves that Bot Guard queued the event through the configured connection. It does not guarantee that every GA4/GTM rule, consent configuration, browser extension, ad blocker, or analytics property accepted it. Confirm the event at the destination.

Troubleshooting

  • Check that analytics tracking is enabled and the selected mode is correct.
  • Validate the ID format and ensure the site does not load conflicting containers.
  • Review consent-management behavior and Content Security Policy.
  • Use GTM Preview or GA4 DebugView rather than waiting for standard reports.
  • Remember that browser privacy tools can block client-side analytics without affecting Bot Guard’s local strikes.