A few months ago we switched from JavaScript to Server Side Tracking (SST), using the following information and code:
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#tid
https://github.com/theiconic/php-ga-measurement-protocol
The issue at hand is How do we get demographics data in Google Analytics (Universal) when using Server Side Tracking. The current setup is to get the _ga cookie from GTAG without sending a pageview - and then use that Cookie as Client-ID.
I found the following page about where Demographic data comes from; but can't figure out what i am Missing or need to get the data into GA.
https://support.google.com/analytics/answer/2799357
I hope that you can offer som insight or a potential solution.
Edit: The current setup initializes the _ga/_gid cookie with GTAG without triggering a pageview, and then use _ga > _gid > phpsessid as the Client-ID in the SST calls
Related
I am trying to send event data to Google Analytics 4 through a Google Tag Manager Server container. This setup will later be used to track an app for which we will not be using the Google SDK. However whatever I try, I can't seem to record users within GA4, even though the events are recorded.
Currently, I send an HTTP POST request from Postman to our Google Tag Manager Server container, which is captured by a custom Client and is processed by the official GA4 tag. Within the GA4 tag, I map the original event data to the event data needed by GA4. The request that is sent is shown below:
Also, GTM shows a 204 response code.
When the GA4 tag sends the request to GA4, I do see the event coming in, but no user is recorded:
Which parameters am I missing that are required?
(Yes, I know that there are dedicated App streams within GA4, but you have to connect your account to Firebase, which is exactly what we do not want for our setup. Therefore, I set up a web stream.)
I am trying to use the Google Analytics Measurement Protocol to record some events happening on my server-side code. I am using the REST API as suggested here but I don't see any events on the Google Analytics dashboard.
When I try to add the event via the Google Analytics Hit Builder, then I am able to see that event in the dashboard.
I don't think any authentication is required while using the REST API and only a correct tracking ID is required which is present. I have confirmed that the POST request is not failing.
I am looking at the Realtime > Events to check whether the events are pushed or not. Is there a place where I can check the historical data to see if the events are present there.
Thanks!
I'm having issues with tracking advanced e-commerce transactions through Google Measurement Protocol. I want to use this because we can track sales with the most accuracy if it is done server-side. So we take over the cid from the frontend and track a sale as soon as the payment has been done. I have done this before in the exact same way but for some reason it doesn't work this time, or only works around 50% the time, depending on the tracking ID we use.
I am sending the following payload to: https://www.google-analytics.com/collect (changede UA code for the example):
v=1&t=event&tid=UA-MYCODEHERE-1&cid=532571481.1547156684&el=91901.000001&pr1ca=weekendje-weg&ni=1&uid=1337&pr2qt=1&tr=64.65&pr1br=Some%20Location&pr2va=3%20dagen%20-%20Standaardkamer&pr2id=DRTA-4379&ea=purchase&pr1va=3%20dagen%20-%20Standaardkamer&cu=EUR&ta=Some%20Location&pr2ca=weekendje-weg&pr2nm=Some%20Location%20Somewhere&ec=checkout&pr2br=Some%20Location&pr1pr=158.00&pr1qt=1&ti=91901.000001&pr1id=DRTA-4379&pr1nm=Some%20Location%20Somewhere&pa=purchase&pr2pr=158.00&ts=0
This validates in the Hit builder and using the Debug URL, I log all outgoing measurement protocol hits and they are always triggered and always return a status code 200, I have enhanced e-commerce tracking enabled for the tracking id and no filters there (brand new Analytics account) but my hits never show up for this account in Analytics (even after waiting for days still no single measure).
I'm not sure what's going on, I did this before like this and it always worked fine. Am I missing something? I tried switching to measurement protocol via http or https, GET or POST, etc, it all doesn't help. I did have this exact code working for a older property but it wasn't reliably tracking all transactions, now it's just tracking none. I think I tried everything I could, is this a Google Measurement Protocol/Analytics bug or am I missing something?
We are tracking events and screenviews using Firebase Analytics and Google Tag manager (GTM). GTM will then send the hits to Google analytics (GA).
I believe we have correctly setup the GTM tags needed, inserted the code and installed what needs to be installed as instructed here.
I am now moving on to test if the hits are properly sent by GTM to GA. And we opt to use Charles Proxy to record the hits. Although we can see hits to GA getting recorded, we can't see the parameter 'gtm' from the request. For example, for screenview, the request sent to GA was like this:
is this expected? Or should we see the GTM Container ID with the request for us to confirm that our setup is working correctly?
Also, is there any other way for us to check if the hits sent to GA is from GTM?
Thank you so much!
I have done the following:
Added GTM tracking snippet
Set up a GA (UA) tag of type 'Pageview'
Published version
I am getting data in, (Users, Sessions and Pageviews and Real-Time)
But, also receiving this notification in the GA UI:
"No Hits Property [MYPROPERTYID] is not receiving hits."
All I have been able to find suggests that maybe the tracking code is somehow "broken", but the code on the page seems to be identical to that which is given by GTM.
Also, as mentioned, data seems to be coming in fine.
How can I beat this error? Is there something I have neglected to do in my workflow that is leaving GA unsatisfied (such as an additional GA tag of some kind)?
Did you just very recently create the Account or Property in Google Analytics? It may take up to 24 hours before the data is completely processed, which would explain that Notification.