HookGet Open dashboard

Google Analytics 4 → HookGet

HookGet reads Google Analytics 4's reporting API on a schedule and turns it into normalised events on the same pipeline as everything else you deliver.

In short

  • Reads the GA4 Data API (runReport) with a service account — grant it viewer access on the property and paste its JSON key. No OAuth dance.
  • One event per settled day: web.traffic_reported with active_users, sessions, screen_page_views — or up to 8 metrics you choose.
  • Days are read once, two days after they close — GA4 finalises numbers for up to 48 hours, and an event that changes value after delivery is worse than one that is late.
  • Daily aggregates only: no user-level data leaves the property, and the events honestly carry containsPii: false.

What it produces

Read from the APIBecomesData
One settled day of the propertyweb.traffic_reportedactive_users, sessions, screen_page_views (default) — or your own metric list

Set up

# 1. Google Cloud console: create a service account, download its JSON key
# 2. GA4 Admin -> Property access management: add the service account email as Viewer
curl -X POST https://api.hookget.com/v1/sources \
  -H "authorization: Bearer $HOOKGET_KEY" \
  -d '{"provider":"google-analytics",
       "secret":"<the JSON key file, pasted whole>",
       "config":{"property_id":"123456789","metrics":["activeUsers","sessions","conversions"]},
       "backfill_from":"2026-06-01T00:00:00Z"}'
One scheduled sync of a pull source The scheduler claims a due source, fetches from the provider's API with the saved cursor, normalises the response into events, and stores them. Only when the sync succeeds does the cursor advance. A failure keeps the old cursor and retries with a growing backoff; after twenty consecutive failures the source pauses and reports its health. Due interval passed Fetch from the saved cursor Normalise dedupe on provider ids Stored, cursor advances only on success — never mid-failure Failure: old cursor kept backoff doubles · 20 strikes → paused, health says why
The two rules that make polling safe: the cursor advances only on success (a partial read never silently skips events — re-reads deduplicate for free), and a failing credential backs off and eventually pauses instead of hammering the provider in your name.

Stated plainly

GA4 keeps refining a day for 24–48 hours, so each day is read once, two days after it closes. This connector is for the durable daily record — spend joins, weekly reports, anomaly alerts — not for the realtime card in the GA4 UI, which their API exposes separately and less stably.

Questions

Why a service account and not my Google login?

A service account is a credential you can scope to one property and revoke in one place, without touching your own account. Granting it Viewer on the property is one step in GA4 Admin, and the JSON key is stored encrypted — no route ever returns it.

Can I choose which metrics arrive?

Yes — config.metrics takes up to eight GA4 metric API names (activeUsers, conversions, totalRevenue…). They arrive snake_cased as event metrics, validated before the source is created.