https://www.growthbook.io/ logo
a

ancient-tomato-10876

03/19/2023, 1:29 PM
Hi, how can I connect tracking callback to GA4 and BigQuery in php?
f

fresh-football-47124

03/19/2023, 4:33 PM
Hi Norbert - which part are you stuck on?
a

ancient-tomato-10876

03/19/2023, 4:59 PM
it needs a callback function to ga4, in the documentation there is only an example from segment.io
f

fresh-football-47124

03/19/2023, 5:01 PM
You’re doing server side A/B testing/feature flagging?
a

ancient-tomato-10876

03/19/2023, 5:08 PM
Yes
f

fresh-football-47124

03/19/2023, 5:08 PM
So you can can send custom events to GA4 in the trackingCallback from php
there are two ways
1. use a server side CURL to ga4
or 2. add something to the HTML/JS you generate to trigger a call to GA4 on page load
a

ancient-tomato-10876

03/19/2023, 5:12 PM
ok thanks, I thought maybe there was a code snippet ready.
f

fresh-football-47124

03/19/2023, 5:13 PM
I don’t have one- - but here is an example of a server side call
and I’d suggest you grab the client_id from the cookie as I’m not sure it would automatically be added server side
a

ancient-tomato-10876

03/19/2023, 5:19 PM
Thanks. I'll make something up. I'll ask just in case.
2 Views