Google measurement protocol transactions not being recorded - google-analytics

I am issuing GET requests as defined in the Google Measurement Protocol from our server to record offline conversions.
The following test request (tracking id obfuscated)
https://www.google-analytics.com/debug/collect?v=1&tid=xx&cid=111300&t=transaction&ti=1500000&tr=100
validates against the /debug Endpoint (using Postman)
{
"hitParsingResult": [ {
"valid": true,
"parserMessage": [ ],
"hit": "/debug/collect?v=1\u0026tid=xxu0026cid=111300\u0026t=transaction\u0026ti=1500000\u0026tr=100"
} ],
"parserMessage": [ {
"messageType": "INFO",
"description": "Found 1 hit in the request."
} ]
}
And shows up in the Sales Performance report in Google Analytics when submitted to the production endpoint using PostMan (i.e. without /debug/)
However I can't see any of the actual production data, submitted from the server in the Sales Performance report.
Any ideas?

This is kind of tricky, yes the transaction is valid,but the debuger only check the syntaxis, but your Google Analytics configuration has not enabled that type of hit (t=transaction, That is only for Standart E-commerce). In my test account, I run that hit and this work. In your case, if your account is enhanced e-commerce is being filtered on the processing.
So here is a screeshot of you hit on my test view running on classic ecommerce.
So you have 2 options to fix this, downgrade you e-commerce (not recommendable in all the cases)
Downgrade
If you do want to use that syntaxis, you have to uncheck the enhance e-commerce and that should work in your case. With your hit and with my configuration this works (a new account w/no filter and standard e-commerce enabled)
Attach information
The enhanced ecommerce was designed to be send attached with other hits (on event or pageview mainly).
For example, this hit is a no interaction event and it's valid for receive transaction and the purchase. Use no interaction events avoid fake sessions and allows to you import the data of the transaction without alter metrics as bounce rate.
https://www.google-analytics.com/collect?v=1&t=event&ni=1&ec=Ecommerce&ea=Transaction&cid=2.2&tid=UA-xxxxx-1&ti=T12345&tr=35.43&pa=purchase

There is a data latency with Google analytics. Officially its 24 - 72 hours before data shows up in the standard reports.
From my own experience I can say depending upon how much data there is in your account you can see it as early as 12 - 24 hours.
If the debug end point says its a valid it you can assume its working fine.

Related

Transaction HTTPS Request - Server Side Tagging Consolidation Stream

I have a trouble with Server Side Tagging Consolidation Stream. I am trying to use GA4 Stream to dispatch Universal Analytics data to Google Analytics. So far I managed to send data via 2 different streams - one for GA4 and one for UA and they are working fine. I have to mention also that in both situation I am using GTM4WP plugin by Thomas Geiger. But when I am trying to use GA4 stream to send data also to Universal Analytics it doesn't work as I expected. In Universal Analytics I can see purchase event in "Behaviour > Event" or "Real-time > Events" Tabs but I don't see even once transaction in "Conversion > E-commerce - Overview". I checked outgoing request and it looks like bellow (I skip some parameters) (:
tr=89
t=event
ea=purchase
ec=ecommerce
I have and idea that it doesn't work because t parameter is equal do event, not to transaction but I checked working request (without consolidation) and it also has t=event:
tr=0
ec=Enhanced%20Ecommerce
ea=gtm4wp.orderCompletedEEC
el=%2Fcheckout%2Forder-received%2F213251%2F
pa=purchase
t=event
Wham am I doing wrong here?

Google Calendar API - Deeper insight into calendar usage limits exceeded errors

I have an application that's been running since 2015. It both reads and writes to approx 16 calendars via a service account, using the Google node.js library (calendar v3 API). We also have G Suite for Education.
The general process is:
Every 30 seconds it caches all calendar data via a list operation
Periodically a student will request an appointment "slot", it first checks to see if the slot is still open (via a list call) then an insert.
That's all it does. It's been running fine until the past few days, where API insert calls started failing:
{
"code": 403,
"errors": [{
"domain": "usageLimits",
"reason": "quotaExceeded",
"message": "Calendar usage limits exceeded."
}]
}
This isn't all that special - the documentation has three "solutions":
Read more on the Calendar usage limits in the G Suite Administrator
help.
If one user is making a lot of requests on behalf of many users
of a G Suite domain, consider using a Service Account with authority
delegation (setting the quotaUser parameter).
Use exponential backoff.
I'm not exceeding any of the stated limits as far as I can tell.
While I'm using a service account, it isn't making a request on behalf of a user. The service account has write access to the calendar and adds the user as an attendee
Finally, I do not think exponential backoff will help, although I do not have this implemented. The time between a request to insert and the next insert call is measured in seconds, not milliseconds. Additionally, just running calls directly on the command line with a simple script produce the same problem.
Some stats:
2015 - 2,466 inserts, 186 errors
2016 - 25,747 inserts, 237 errors
2017 - 42,815 inserts, 225 errors
2018 - 41,390 inserts, 1,074 errors (990 of which are in the past 3 days)
I have updated the code over the years, but it has remained largely untouched this term.
At this point I'm unsure what to do - there is no channel to reach Google, and while I have not implemented a backoff strategy, the way timings work with this application, subsequent calls are delayed by seconds, and processed in a queue that sequentially processes requests. The only concurrent requests would be list operations.

Firebase Remote Config A/B testing shows no results after 24 hours

I configured Firebase Remote Config A/B testing for Android, and we did rollout on at least 10K devices.
For some reason, I see "0 users" in my A/B test after more than 24 hours.
Firebase GMS version is: 11.8.0
Should it show A/B participants in real-time or it's ok to see 0 users after 24 hours?
P.S: We are able to get AB test variants on test devices through Firebase Instance Id, it works well.
The simplest experiment which is running has only app package as a target, with no additional filters. And it shows 0 users as well.
Finally, we found an answer!
Maybe somebody will find it helpful:
For now, it happens (no data in Firebase remote config A/B test experiment) if you have an activation event configured for A/B test experiment.
If you have 2 different experiments, both will fail to get results even if you have "activation event" configured only in 1 of them.
Additionally, remote config will not work as well, you'll be able to get only default values.
We already reported to Google about, so they'll fix it at some point I hope.
Another useful info which is really hard to get:
How long is it ok to see "0 Total Users" in experiment I've just
started?
It takes many hours before you can see any data in your experiment. We were able to see results only after 21 hours after experiment start, so if you configured everything well, don't worry and wait for at least 24 hours. It will show 0 "Total Users" for many hours after the start.
Should I use app versionName or versionCode in "Version" field of
experiment setup?
You should use versionName.
Some useful info from support:
Firebase SDK
Make sure your users have the version of your app with the latest SDK.
Since your experiment is with Remote Config
When activateFetched() is called, all events from that point on will be tagged with the experiment. If you have a goal or activation event that happens before activateFetched(), such as automatic events like first_open, session_start, etc., the experiment setup might be wrong.
Are you using an Activation Event?
Make sure to call fetch() and activateFetched() before the activation event occurs.
Experiment ID of the experiments (if support asks you about)
It's the number at the end of the URL while viewing experiment results.
This debugging log could be useful to get what is going on
Also:
The good way to check if your experiment is working now is to set it to a specific version you didn't publish yet and check logs from remote config with the fresh app install(or erase all app data & restart).
It should show different variant every time you reinstall the app, since your Firebase Instance ID changes after app reinstall/app data erase.
If you see variants change - then A/B test is running well.
In your "build.graddle": don't forget to set the same versionName which you set in experiment setup.
In my case, I was receiving results of A/B testing but suddenly, it stopped to appear. It had continued for 7 days and then results appeared. Firebase Support manager said:
what I suspected here is just a delay in showing the result in the
experiments
Additionally, she said that
With that, I would suggest always using the latest SDK version and
enabling Google Analytics data sharing.
In my case, I used I wasn't using the latest SDK version, but Google Analytics was enabled for "Benchmarking", "Technical Support", "Account Specialists" except for "Google products & services". I believe these settings were enabled by default (the screenshot from Google Analytics):

How does Google Analytics calculate 10000 requests per Profile?

I am Fetching Data from Google Analytics For Metrics (Pageviews,Unique pageviews, TimeonPAge, Exits) as below
DataResource.GaResource.GetRequest r = GAS.Data.Ga.Get(profileID,startdate.ToString("yyyy-MM-dd"),enddate.ToString("yyyy-MM-dd"),"ga:pageviews,ga:uniquePageviews,ga:timeOnPage,ga:exits");
r.Dimensions = "ga:pagePath";
r.Filters = "ga:pagePath=~ItemID=" + strPagePath + "*";
r.MaxResults = 1000;
GaData d = r.Fetch();`
then I received the following exception after fetching data(Metrics) for some random number of videos:
>>Error while fetching pageviews From GA Google.Apis.Requests.RequestError
>>Quota Error: profileId ga:****** has exceeded the daily request limit. [403]
>>Errors [
>> Message[Quota Error: profileId ga:****** has exceeded the daily request >>>limit.] Location[ - ] Reason[dailyLimitExceeded] Domain[global]
>>]
I am fetching these four metrics( page views, unique views.. so on) for one ItemID.
Does Google Analytics calculate it as 4 different Requests or one single request??
Each request you send against the Google analytics API counts as one. The Quota is not project or user based.
Pagination:
Your request above you are requesting maxResults of 1000 if the total number of rows in your request is 100000 then you are going to have to make 100 requests to get all of the data.
All APIs:
Requests to all of the APIs count against the same quota so if you are also using the management api it counts as well as the reporting api.
All Users and applications:
Now here is the fun part about the current quota system it is not project related.
Lets say my company has a profile 1234567. Now our marketing team all has access. Each member of the marketing team likes different apps. They all install the app they like best. They are all using the same 10000 request quota.
Reset:
Your quota will reset at midnight west cost USA time. No one will be able to access that view id until then. Top tip when testing create a development view under the web property to request from then you wont blow out your production view.

Google Analytics measurement protocol session control not working

I'm trying to use manual session control with the Google Analyitics measurement API, and I cannot get it to work. After a bunch of fiddling, as a basic test case I set up a simple test site in analytics, and manually made the following requests to it:
?v=1&t=event&tid= (myid) &cid= (uid1) &ec=SessionTest&ea=TestStart&sc=start
?v=1&t=event&tid= (myid) &cid= (uid1) &ec=SessionTest&ea=TestEnd&sc=end
?v=1&t=event&tid= (myid) &cid= (uid2) &ec=SessionTest&ea=TestStart&sc=start
?v=1&t=event&tid= (myid) &cid= (uid2) &ec=SessionTest&ea=TestEnd&sc=end
Then looking at the analytics and waiting, the sessions in question still just time out after the normal 30 mins, instead of ending with the "sc=end" request. For example, under the "real-time -> events" page about 5 minutes after making the requests I still both of the "users" under the "Active Users" tab, and the page still claims there are "Right now: 2 active users on the site".

Resources