Zapier integration with Google Analytics 4 (GA4)

  • 3 May 2023
  • 1 reply
  • 290 views

Sunset date for Universal Analytics is quickly approaching and I don’t see a native integration in GA4 as yet. Supposedly, it’s still work in progress, but this isn’t leaving much time to get things reconfigured.

I created a workaround using a “Custom Request” webhook if anyone is interested. Tested and works perfectly:

 

Method: Post

URLhttps://www.google-analytics.com/mp/collect?api_secret=[API-SECRET-GOES-HERE]&measurement_id=[STREAM-ID-GOES-HERE]

Data:

{ "client_id": "SOURCE-DATA-GOES-HERE",

"user_id": "SOURCE-DATA-GOES-HERE",

"non_personalized_ads": false,

"events": [ { "name": "EVENT-NAME", "params":

{ "EVENT-PARAM-1": "SOURCE-DATA-VARIABLE-GOES-HERE",

"EVENT-PARAM-2": "SOURCE-DATA-VARIABLE-GOES-HERE",

"EVENT-PARAM-3": "SOURCE-DATA-VARIABLE-GOES-HERE",

"EVENT-PARAM-4": "SOURCE-DATA-VARIABLE-GOES-HERE"

 } } ] }

Unflatten: Yes

 

Pass as many variables as you wish. See GA4 measurement protocol for documentation and references to values.


1 reply

Does yours show up in realtime reports? Documentation says you have to add a session id and the “engagement_time_msec" for it to show in standard reorts such as realtime?

If you are adding that what are you using to generate the time?

Reply