Custom Loader: duplicate click_phone/click_mail events (gtag service w

Hello Stape team and community,

I’m running a Stape Gateway (first-party proxy for a web GTM container, no server-side container) and I have a persistent duplication that only affects click-based events, not page_view. Looking for anyone who has found a clean fix at the source.

Setup:

  • Stape Gateway, first-party domain gtm.kosgroup.com (CNAME → stape.net), EU region

  • Web container GTM-XXXXXXX served via Stape custom loader

  • GA4 property (single measurement ID)

  • No server-side GTM container — Gateway acts as a first-party proxy only

Symptom:
click_phone and click_mail arrive duplicated in GA4 (~50%, stable for months, across all pages). page_view, scroll, user_engagement are NOT duplicated (~0.2%). So the duplication is selective: only events that fire after the page has loaded.

What I’ve ruled out (with evidence):

  • Single container load (one gtm.start in source)

  • GA4 tag fires once in GTM Preview (single GA4 tag among fired tags)

  • Both hits carry the same tid — not a second measurement ID

  • No hardcoded gtag.js besides GTM

  • Enhanced Measurement “Outbound clicks” disabled, tested in incognito → duplication persists

  • No “Create event” / “Modify event” rules in GA4

  • Link markup (tel:/mailto:) verified clean

The two hits (same session, single physical click):
Identical in tid, cid, _p, sid, en, ep.link_url. Both go to region1.analytics.google.com/g/collect. They differ only in:

  • _s: 3 vs 4 (sequential)

  • _et: 7418 vs 1 (second one reset)

  • gtm=: the second hit is missing a block present in the first (...z89180086559za20... vs ...za20...)

  • _eu: AgAAACQC vs AAgAACQC

This matches the documented gtag ↔ service worker retry bug (Google release note March 2025; Stape’s own “GTM & gtag Service Workers” article; PPC.land Sept 2025): gtag sends with suppressSuccessCallback=true, the service worker doesn’t acknowledge back, gtag re-sends. The selectivity (only post-load events, page_view unaffected because the SW isn’t active yet at load) is the known signature.

Question: has anyone applied a clean, production-safe workaround for this on a Stape Gateway setup? I’ve seen mentions of blocking specific service-worker files or removing the iframe via MutationObserver, but I’m wary of applying those on a site serving 17 locations without validation. Is there a recommended approach, or a Gateway/loader setting that avoids the double send?

(For now I’m deduplicating downstream in BigQuery, which keeps my KPIs correct — but I’d like to fix it at collection level.)

Thanks!

Danilo

Hi @danilo.bernabeo!

I’ve just checked and noticed that your GA4 Data Stream is duplicating these events because someone enabled the “Create Event” feature in it. There’s nothing to do with Service Workers.

Whenever a click_mail and click_phone happens, a new one is generated with the same parameters and event name.

Just make sure to disable it and you’ll be fine :slight_smile:. Or, at least change the event name.

1 Like

Hi @giovaniortolani,

You nailed it, thank you! :folded_hands:

You were spot on: two self-referential “Create Event” rules at the Data Stream level, each recreating the event with its own name. Disabled both, checked in DebugView, now a single event fires. Solved at the source.

I’d gone down the rabbit hole chasing the gtag/service worker bug because the hit pattern looked exactly like that; a good reminder to check the simplest explanation first.

Really appreciate you taking the time to look into it!

Cheers :beer_mug:

1 Like