GA4 / GTM Server

Forward events to GA4 via Measurement Protocol or to a server-side GTM container.

Prefer screenshots over text? Open the illustrated manual setup guide →

GA4 (Measurement Protocol)

AdsPing forwards events to GA4 via the Measurement Protocol. You provide a Measurement ID + API Secret; AdsPing posts events server-side as the right user (client_id from pb.js).

Find your credentials

  1. GA4 admin → Data Streams → pick your web stream.
  2. Copy the Measurement ID (format G-XXXXXXXXXX).
  3. Click Measurement Protocol API secrets → Create → name it "adsping" → save.
  4. Copy the API Secret.

Connect in AdsPing

  1. Pixel detail → GA4 card → Manual setup.
  2. Paste Measurement ID + API Secret → Save.
  3. AdsPing validates by sending a test event to GA4's /debug/mp/collect endpoint. Card turns green if the credentials work.
GA4 has its own real-time view: GA4 → Reports → Realtime → DebugView. Events show within seconds when debug_mode: true is set in the payload. AdsPing doesn't toggle this automatically yet — to test, use the GA4 Realtime report (60-min window) which shows production events.

GTM Server container

If you run a server-side GTM container, AdsPing can forward events to its endpoint instead of (or alongside) GA4 directly.

  1. GTM dashboard → server container → Server URL (e.g. https://gtm.example.com).
  2. Optional: Container ID (GTM-XXXXX) for routing inside the container.
  3. AdsPing pixel detail → GTM card → paste both → Save.
  • AdsPing posts to {server_url}/g/collect with the GA4 measurement protocol body — works with the standard GA4 Client in your server container.
  • From there your GTM container can fan-out to other destinations (Snapchat, custom HTTP, etc.).