Thank you! If I do not include the session ID in the request but do include the client ID, will all dimensions be set to (not set)? Meaning the event would exist in GA4, but would not be tied to an actual user with any useful information (e.g. country, region, etc.)
Hi Julius, does this mean that GA4's measurement protocol is useless for businesses with long offline conversation cycles for campaign attribution? i.e. when purchase event sent after 1 week via MP despite utilizing session ID?
That is so dumb. In my usecase, clients come to the website from an Ad, schedule a appointment on the showroom (which could be more than 3 days away), and then the purchase is done in store. Even if I dont send the purchase event with the session_id (which would be invalid), I would still send the client_id and have a way to visualize that clients that came from the Ad X spent Y amount. Is there a way to do it?
Thank you, great video as always)) it's super useful for building end-to-end analytics having data not only aggregated by users but by sessions. thanks (once again) for grate video
Haha when at the end you mentioned that the documentation isn't al that great I was like... "Yeueueuep". Also the reason why I went looking for a video & this video was superb! Thx for the introduction.
It's useful information, thanks a lot for share it. I have a question about sending an event with measurement protocol, the doc use an example sending directly to GA4 but I don't found how I send directly to GTM. The issue is that I need to send an event to GTM in offline that depend with a Webhook. So, it have a doc official about the GTM on server-side but not is exactly I need (I guess). I think that I don't need the server container just to send an event as behavior the measurement protocol GA4, right? What is the best way to send a simple event to GTM without creating the container server??
Thank you so much, I was receiving a ton of random traffic and it was only showing as "not set" so no idea what I did right (or wrong) to receive a sudden influx. Hopfully the next time an influx occurs I can measure if better.
Thanks for your epic video! There is one thing I do not understand.. When I want to track offline conversion events that sometimes happen more than 2 weeks (maybe even a month sometimes) after a user submitted a form. And you say you can only connect it to a session by adding the session id and the timestamp in the past, but only for less than 72 hours. So that means you can never connect it to the initial session, correct?
Do you have any videos detailing how to include campaign events and how to set the source / medium / id? I'm passing them in but it never reflects on the acquisition.
Very helpful video. Thank you. But I have a one question: is it possible to debug measurement protocol events in other tools? (not in GA4) I mean events that already exist on the page. And adding debug_mode doesn't help (still don't show events in GA4 DebugView)
This seems to work in a first party context, but what if you are in a third party context (our application is typically d into a parent page so we operate as a third party) which is going to be a conflict with the third party cookie change coming in Q3. Any thoughts?. We won't use consent mode and never expect to operate as a first party.
Thanks as always a helpful video. Will you make a video about the new item scope for dimensions in GA4. It is new and until now there are no real information on how to use it, for example how to track custom product information in the current GA4 recommendet event data layer. For instance if a company wants to track if a product is sustainable (yes/no), there is currently no default dimension in the purchase event, so it must be tracked custom.
I tried sending item scope params within mp purchase event and it worked. It does not validate event on ga dev web site. You can copy request info and payload then ask for chat gpt to translate into a python request code finally u can send event request with item scope params to ga4. In my scenario it appeared on custom definitions interface after a few days, then I could set it as a item scope custom dimension. Hope it works for you too!
@@seco_oces thanks for the answer. Do you know how to do it via tag manager. Specifically I'm looking for how the datalayer should look like. Since in the default case items is an array within the purchase event i don't really understand how it would look like. In UA I would just put a new field in the array and use a custom Java script to extract the values. Then I would send it to UA with a pipe (|) as delimiter between two or more values, since people could buy more than one product. I don't know if GA4 will also be able to recognize the pipe as delimiter.
@@seco_oces okay after some tests yesterday, I found a way to actually use the item scope in GA4. It seems like GA4 recognizes every non default parameter in the items array. In GA4 you can easily create the item scoped dimensions
Hi Julius, Thanks for the video. Are there any ways in which we could launch these calls via Zapier? I've checked the documentation and I didn't find any features related, so I thought if it could be possible to launch this as a webhook or similar.
Note that if you want it to be consider as part of the same client ID & session ID I also think you need to send it within 72 hours after the session expired.
Hi! Like your videos - super useful and understandable. However, I need to send APP events to GA4 using the Measurement Protocol. Does this implementation work for it as well? Or does this require another implementation? I have web campaigns where users can be redirected to the App/Google Play Store and make purchase there. Also, I want to use UAC campaigns, so I need to implement the backend event of in_app_purchase (firebase in_app_purchase doesn't work for me fine)
Thanks for the video. Can anyone tell is ga4 will store this event for same device, location and lang (considering it's having correct session_id, timestamp and within 72 hours). Because there is no way to send ip, user-agent and lang (and it was possible in universal analytics). I am doing migration now and ga4 api is really not that good as in ua.... Thanks for answers in advance.
@@AnalyticsMania Do you think it will affect Google Ads optimization? In Universal Analytics it worked perfectly and I am not sure how to track purchase events, since MP Ga4 no allowing to send specific information about hit
Great video but something huge makes no sense. How could it be possible to grab and provide client and session every single time. The way this is being presented is as if these are extracted and hard coded for each event which would be a huge programming mess unless google has an api to get these automatically. I really want to use ga4 events for offline behavior but this just doesn’t make sense as a scalable solution. Any thoughts?
Hi Julius, I have one query. after setting up all the parameters, do I need to put the request info script somewhere on my server where my project is hosted?
Hits are still being collected client side but sent to a single server side endpoint (middle man) of which then receives and sends the hits to GA data collection servers
@AnalyticsMania should the values should be left undefined? Or filled with example values? I've never done something like this before, pardon my ignorance. Also where to add this payload? In Google Tag?
Very nice video. Would you have something similar when using Firebase Analytics? As far as I'm reading, you can not fetch the client_id & session_id when Firebase Analytics is in play.
Very useful video; thanks for your effort. I have a question: Does it make sense to send data to GA4 with Measurement Protocol while using GTM to configure GA4 and send E-commerce data with GTM to GA4?
Real-time reports show user properties and event parameter. Custom dimensions exist only in the GA4 UI. Are you referring to how to send user properties when using measurement protocol?
great video: documentation is horrible therefore you video explain a bunch of things that I wasn't doing, I want to applied this from backend what could I use instead of _ga cookies for client_id and session_id
I feel like ive it all precisely and still it doesnt seem to show up in debug view or events, HELP Edit: i had NULL values in certain fields in the Items object array and so it broke everything. NB: NO NULL in the code
There is one problem with using session id. Maybe someone will correct me if I'm wrong. But suppose we want to supplement the old session with a new parameter (e.g. session from March 1st). We send an e-commerce notification via Measurment Protocol on April 1 that the March 1 session needs to be updated with an e-commerce transaction (typical for lead generation and delayed sales). But if we send this session ID on April 1, not only will we automatically extend the session time from March 1 to April 1, this transaction ID will appear every day during this period. Am I right? And the question is: what we have to do if we want to update session from one month ago?
in this case can't you send the events with a new session Id using the same client_id? In theory this supplement would happen in a different session since it's a delayed sale.
THANK YOU! The Google documentation on this is hopeless but this video is terrific.
Best video I've found regarding this topic. Thank you very much!
Thank you! This was an excellent tutorial. Very invaluable recommendations contained in this video.
Thank you! If I do not include the session ID in the request but do include the client ID, will all dimensions be set to (not set)? Meaning the event would exist in GA4, but would not be tied to an actual user with any useful information (e.g. country, region, etc.)
Useful information for ga4
Thank you so much !!!!!!. You help me a lot, regards from Perú
Hi Julius, does this mean that GA4's measurement protocol is useless for businesses with long offline conversation cycles for campaign attribution? i.e. when purchase event sent after 1 week via MP despite utilizing session ID?
For its built in attribution models used with the UI, yup.
@@Danny805123456 Sucks! Those "late" offline conversion events then can not be used to optimize Google Ad campaigns.
That is so dumb. In my usecase, clients come to the website from an Ad, schedule a appointment on the showroom (which could be more than 3 days away), and then the purchase is done in store. Even if I dont send the purchase event with the session_id (which would be invalid), I would still send the client_id and have a way to visualize that clients that came from the Ad X spent Y amount. Is there a way to do it?
Use offline conversions of Google Ads. Two different things...
@@sharmaritvik
Thank you, great video as always)) it's super useful for building end-to-end analytics having data not only aggregated by users but by sessions. thanks (once again) for grate video
Haha when at the end you mentioned that the documentation isn't al that great I was like... "Yeueueuep". Also the reason why I went looking for a video & this video was superb! Thx for the introduction.
That's just great, just great Julius, thank you so much for the detailed explanation.
It's useful information, thanks a lot for share it.
I have a question about sending an event with measurement protocol, the doc use an example sending directly to GA4 but I don't found how I send directly to GTM.
The issue is that I need to send an event to GTM in offline that depend with a Webhook.
So, it have a doc official about the GTM on server-side but not is exactly I need (I guess).
I think that I don't need the server container just to send an event as behavior the measurement protocol GA4, right?
What is the best way to send a simple event to GTM without creating the container server??
So useful! Thank you!
Great video and is of great help, i was stuck with the same issue you addressed in this video.
Thank you so much, I was receiving a ton of random traffic and it was only showing as "not set" so no idea what I did right (or wrong) to receive a sudden influx. Hopfully the next time an influx occurs I can measure if better.
Thanks for your epic video! There is one thing I do not understand..
When I want to track offline conversion events that sometimes happen more than 2 weeks (maybe even a month sometimes) after a user submitted a form.
And you say you can only connect it to a session by adding the session id and the timestamp in the past, but only for less than 72 hours. So that means you can never connect it to the initial session, correct?
Do you have any videos detailing how to include campaign events and how to set the source / medium / id? I'm passing them in but it never reflects on the acquisition.
Great video! Thanks for help
Top
Is session id necessary for the events if we don't care about traffic sources?
Very helpful video. Thank you. But I have a one question: is it possible to debug measurement protocol events in other tools? (not in GA4) I mean events that already exist on the page. And adding debug_mode doesn't help (still don't show events in GA4 DebugView)
How are those events being tracked? The debug_mode event parameter should be sent along with every GA4 event you want to debug.
Not sure what you mean by “other tool”
This seems to work in a first party context, but what if you are in a third party context (our application is typically d into a parent page so we operate as a third party) which is going to be a conflict with the third party cookie change coming in Q3. Any thoughts?. We won't use consent mode and never expect to operate as a first party.
Thanks as always a helpful video. Will you make a video about the new item scope for dimensions in GA4. It is new and until now there are no real information on how to use it, for example how to track custom product information in the current GA4 recommendet event data layer. For instance if a company wants to track if a product is sustainable (yes/no), there is currently no default dimension in the purchase event, so it must be tracked custom.
I tried sending item scope params within mp purchase event and it worked. It does not validate event on ga dev web site. You can copy request info and payload then ask for chat gpt to translate into a python request code finally u can send event request with item scope params to ga4. In my scenario it appeared on custom definitions interface after a few days, then I could set it as a item scope custom dimension. Hope it works for you too!
@@seco_oces thanks for the answer. Do you know how to do it via tag manager. Specifically I'm looking for how the datalayer should look like. Since in the default case items is an array within the purchase event i don't really understand how it would look like. In UA I would just put a new field in the array and use a custom Java script to extract the values. Then I would send it to UA with a pipe (|) as delimiter between two or more values, since people could buy more than one product. I don't know if GA4 will also be able to recognize the pipe as delimiter.
@@seco_oces okay after some tests yesterday, I found a way to actually use the item scope in GA4. It seems like GA4 recognizes every non default parameter in the items array. In GA4 you can easily create the item scoped dimensions
@@Lennardwil Happy to hear that
Hi Julius,
Thanks for the video.
Are there any ways in which we could launch these calls via Zapier? I've checked the documentation and I didn't find any features related, so I thought if it could be possible to launch this as a webhook or similar.
Yeah, you can use the webhook action to send out a post request with the MP data :)
Brilliant vid by the way
What should I fill the app_instance_id field with?
Note that if you want it to be consider as part of the same client ID & session ID I also think you need to send it within 72 hours after the session expired.
Hi! Like your videos - super useful and understandable.
However, I need to send APP events to GA4 using the Measurement Protocol. Does this implementation work for it as well? Or does this require another implementation?
I have web campaigns where users can be redirected to the App/Google Play Store and make purchase there. Also, I want to use UAC campaigns, so I need to implement the backend event of in_app_purchase (firebase in_app_purchase doesn't work for me fine)
Thanks for the video. Can anyone tell is ga4 will store this event for same device, location and lang (considering it's having correct session_id, timestamp and within 72 hours). Because there is no way to send ip, user-agent and lang (and it was possible in universal analytics). I am doing migration now and ga4 api is really not that good as in ua.... Thanks for answers in advance.
Measurement protocol events don't reuse anything from the session/user
@@AnalyticsMania Do you think it will affect Google Ads optimization? In Universal Analytics it worked perfectly and I am not sure how to track purchase events, since MP Ga4 no allowing to send specific information about hit
Great video but something huge makes no sense. How could it be possible to grab and provide client and session every single time. The way this is being presented is as if these are extracted and hard coded for each event which would be a huge programming mess unless google has an api to get these automatically.
I really want to use ga4 events for offline behavior but this just doesn’t make sense as a scalable solution. Any thoughts?
It's really a huge problem? You would set your events to get the cookies every time they trigger.
Save the google client id from the cookie into the DB for offline events, same can be done with session for that specific session.
Hi Julius, I have one query. after setting up all the parameters, do I need to put the request info script somewhere on my server where my project is hosted?
Hi, can you please explain how using ga4 measurement protocol is different from server-side tagging using GTM.
Hits are still being collected client side but sent to a single server side endpoint (middle man) of which then receives and sends the hits to GA data collection servers
Hi Julius, please how to send refunds to GA4 in bulk. We have a large number of orders and of those approx 140-160 cancelled orders per month.
I have seen cookies of my website, I am not able to see _ga client id what could be the reason?
Do we add variables in the value areas?
What variables? I am just showing an example of requests that shouod be sent. There are no variables here
@AnalyticsMania should the values should be left undefined? Or filled with example values? I've never done something like this before, pardon my ignorance.
Also where to add this payload? In Google Tag?
can i send a session id and client id after 5 days. does it expire?
Very nice video. Would you have something similar when using Firebase Analytics? As far as I'm reading, you can not fetch the client_id & session_id when Firebase Analytics is in play.
Hi, no, I don't have firebase videos
@@dzengiztafa510 Hi! Did you solve the problem ? I had the same report from analytics guys. Cant find any setup for it in the Firebase.
Very useful video; thanks for your effort.
I have a question: Does it make sense to send data to GA4 with Measurement Protocol while using GTM to configure GA4 and send
E-commerce data with GTM to GA4?
👀
Could you give information about "realtime user custom dimension process of Measurement Protocol for GA4" Thanks a lot.
Real-time reports show user properties and event parameter. Custom dimensions exist only in the GA4 UI.
Are you referring to how to send user properties when using measurement protocol?
great video: documentation is horrible therefore you video explain a bunch of things that I wasn't doing, I want to applied this from backend what could I use instead of _ga cookies for client_id and session_id
it sucks that google is limiting timestamp to 72hrs. most of my clients converting leads in weeks if not months
I feel like ive it all precisely and still it doesnt seem to show up in debug view or events, HELP
Edit: i had NULL values in certain fields in the Items object array and so it broke everything. NB: NO NULL in the code
Can you paste the payload that you’re using
You will need session_id and another parameter (don’t remember it on top of my head) along with debug_mode set to 1 in order to enable it
I've solved it, in my edit i explain the error i was facing
There is one problem with using session id. Maybe someone will correct me if I'm wrong. But suppose we want to supplement the old session with a new parameter (e.g. session from March 1st). We send an e-commerce notification via Measurment Protocol on April 1 that the March 1 session needs to be updated with an e-commerce transaction (typical for lead generation and delayed sales). But if we send this session ID on April 1, not only will we automatically extend the session time from March 1 to April 1, this transaction ID will appear every day during this period. Am I right? And the question is: what we have to do if we want to update session from one month ago?
You can send events to the past max 72 hours
And if you are sending events to the past, you must include timestamp of the past.
@@AnalyticsMania if i exceed 72 h it means that event won't be received in GA4?
in this case can't you send the events with a new session Id using the same client_id? In theory this supplement would happen in a different session since it's a delayed sale.
@@eduardofernandes9881 a new session id is not necessary if you don't want to link event sending to the past.
❤
How send parameteres via Google Analytics 4 Measurement Protocol : IP , UserAgent , campaign data ?