SaTracking
PlatformsUPDATEDIntermediate

Set up a GA4 web event without duplicate tags

Choose one Google tagging path, send a named event with parameters, and verify it in Realtime and DebugView.

Download for AI (.txt)

Measurement topic illustration · SaTracking

Before you start

Install the Google tag once, send a confirmed generate_lead event, and check the tag, measurement ID and DebugView receipt without duplicate collection. Use a test property while setting this up.

1. Install the Google tag once

For a direct gtag.js install, place this in the shared head and replace both example measurement IDs. G-XXXXXXXXXX is a placeholder.

html
<!-- Google tag: replace both placeholders with your GA4 measurement ID -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX');
</script>

If GTM already owns your tags, configure the Google tag there instead of installing a second copy. The config call can send a page_view, so check your current setup before adding another. If consent is required before Google loads, do not load this code before the visitor makes that choice.

2. Send a confirmed event

Call GA4 after the application confirms that the form succeeded:

js
gtag('event', 'generate_lead', { form_type: 'demo' });

Replace demo with a controlled value that does not identify anyone. With GTM, send a generic data-layer message, create a Custom Event trigger and variables, and map them into a GA4 Event tag. The queue message does not reach GA4 unless a configured tag forwards it. Do not send both the direct call and GTM tag for the same action.

3. Verify the result

Use Tag Assistant to confirm the intended tag, measurement ID, and parameters. Then check GA4 DebugView and Realtime. A browser request or detected tag shows attempted delivery, not that GA4 processed the event.

Check for duplicate base tags, SPA route listeners, consent blocking, filters, and the wrong property. See Google's Google tag guide, GA4 event guide, and DebugView help. Use the dashboard to inspect browser-visible activity, then confirm event receipt in GA4 DebugView.

Official references

EDITORIAL HISTORY

What changed

  1. v1.0
    Initial bilingual guide; provider setup and validation steps checked against official documentation.
  2. v1.1
    Revised both language versions with verified provider code and clearer data-layer-to-tag mapping; checked official setup and validation references.
MEASUREMENT SUPPORT

Need a hand with your tracking?

Nicolas Salazar works with teams on analytics, tracking plans, data quality, consent, and implementation.