← All docsChannel setup · GA4

GA4 — Measurement Protocol

Server-side dispatch to Google Analytics 4 via the official Measurement Protocol. Two values, both pulled from the GA4 web property that should receive Beaconry events.

Reading time: ~4 minLast updated: 2026-05-02

1. Find Measurement ID and API Secret

  • Open Google Analytics and click the gear icon (Admin) bottom-left.
  • Under Data collection and modification, pick Data streams.
  • Click the web stream that should receive Beaconry events.
  • The Measurement ID looks like G-XXXXXXXXXX. Copy it.
  • Scroll down to Measurement Protocol — API secretsCreate.
  • Nickname it "Beaconry plugin" → Create → copy the secret value.

2. Paste credentials into Beaconry

WordPress Admin → Beaconry → Tracking → Google Analytics 4. Paste both values. Save.

The API Secret is encrypted at rest with AES-256-CBC. Constants alternative: BCNR_GA4_MEASUREMENT_ID and BCNR_GA4_API_SECRET in wp-config.php.

3. Send the test event

Click Send GA4 test event. Beaconry fires a synchronous test event beaconry_test_ping to the Measurement Protocol and reports validation back inline.

Check GA4 → Reports → Realtime within ~30 seconds. The event should appear with the right user-agent and source.

4. Recommended GA4 property settings

These are inside GA4, not Beaconry. They prevent common pitfalls.

  • Data retention: 14 months. Admin → Data Retention. Default is 2 months, too short for year-over-year comparisons.
  • Reporting currency. Admin → Property details → Reporting currency. Switch to EUR if events use EUR.
  • Mark events as conversions. Configure → Events → toggle "Mark as conversion" on generate_lead, submit_application, sign_up, purchase, contact.
  • Realtime + DebugView for testing. Reports → Realtime shows events within ~30s. DebugView only shows events with debug_mode: true in the payload (Beaconry can be put into debug mode via the Advanced tab).

What ships automatically

  • page_view on every consented page load.
  • user_engagement at 50 percent scroll plus 10 seconds.
  • generate_lead on every Kadence Blocks Form or Fluent Forms submission.
  • add_to_cart, begin_checkout, purchase for WooCommerce. Includes line items, currency, value.

Stable per-order event_id for cross-device deduplication if you also run a browser-side gtag setup in parallel.

Troubleshooting

  • "validation_messages" in the Measurement Protocol response. Beaconry's debug endpoint catches these. Logs tab → GA4 dispatches → click any to see Google's validation feedback.
  • Events in Realtime but missing in standard reports. GA4 standard reports have a 24-48 hour processing delay. Realtime is the source of truth for "did the event arrive".
  • "User Property limit reached". GA4 caps custom user properties at 25 per property. Beaconry uses three (user_id, nl_pref_state, nl_attribution). If you also use gtag with custom properties, you might hit the cap.