GA Reporting API v4 ga:users count not matching the UI - google-analytics

The total number that was returned from the API is actually higher compared to what's being shown in the UI.
Screenshot attached shows Users total count is 5,275.
(https://i.stack.imgur.com/3DEyB.jpg)
However, the API shows 6152 users in total.
(https://i.stack.imgur.com/bJANs.jpg)
Any ideas on how to get valid users count?

The report you are looking at on Google analytics is
Dimension
Date
Metric
users
sessions
pageviews
You have added datehour in your report the results of the report will not be the same unless the request is the same as the report you are looking at

Related

GA measurement protocol tracks event but not enhanced ecommerce purchase

I am currently successfully tracking purchases from website using enhanced ecommerce (via GTM).
I have Goals configured that correctly track these in real time. E.g. event goal for Category = Enhanced Ecommerce and Action = transaction.
However, when I try to track purchases using the measurement-protocol I get the event for the enhanced ecommerce, but I can find nothing in conversion (under the goals or otherwise) about the purchase. I am using the hit-builder.
I have configured various goals and tried many different variations. In my last attempt I created a goal which should match if the label is equal to "serverevent".
Then I sent this:
v=1&t=event&tid=MY_TID&cid=5ca7c46d-a46a-4e0b-a395-b4d1bb228fee&ti=T123415789&ta=test&tr=150&pa=purchase&pr1id=P123459&pr1nm=GiftCard_150&pr1ca=test&cu=EUR&iq=1&ec=Ecommerce&ea=Activation&ni=1&pr1qt=1&el=serverevent
In GA I can see the event coming in with event category "Ecommerce", action "Activation" and label "serverevent", but I see nothing in conversions and the goal still has 0 hits.
I have used POSTMAN to post to https://www.google-analytics.com/debug/collect, and I get back "valid" and "Found 1 hit in the request."
I don't know what else I can try. To be clear I am trying to track server side purchases because these are sales by third parties through our API.
The google analytics standard reports take time to process Google stats it can take between 24 -48 hours for the data to complete processing.
You can see if your hits are being recorded by checking the real time api. As for the standard reports your going to have to wait between 24 - 48 hours to see if the results have completed processing.

Custom Metric data not showing up in Google Analytics

Background
I am currently using Google Tag Manager to populate the Sales amount into a Custom Metric in Google Analytics. This is the code I use to push Sales amount to Google Analytics.
ga('set', 'metric2', {{salesvalue}});
Other information
My custom metric set up in Google Analytics: https://i.imgur.com/kX3aUto.png
I know that the metric is firing with the correct values since it is showing up in GA Debugger: https://i.imgur.com/lGIxCw1.png
Error
Despite the above, I do not see any information in Google Analytics: https://i.imgur.com/WtxChgY.png
Questions
Is there anything wrong with my setup? I have waited over 3 days but still no data.
By using ga('set') does it mean that if a user makes 2 separate purchases in the same session, only the latest sales figure will be reflected instead of the total of the 2 purchases?
Thank you
In your GA Debugger console, the metric2 parameter should be appearing within the pageview send data (along with all the other data being sent to GA at that time). If it is not there, you could be running into a race condition or some other technical issue. If it is there, then you'll know that it is definitely being sent to Google Analytics and something else is wrong. It should not take long to appear, and if you see any rows of data (as you did with your screenshot) the metric data would be there at that time.
Regarding your 2nd question, custom dimensions have scopes that are configured when you create them, but custom metrics simply add up. If I had a custom metric of "clicks on a button" and user clicked it 3 times in their session, the custom metric would be 3. Likewise, if your custom metric is listening for sales value, it will add up to the total value in that session.
Hope that helps at least get you some more clues as to what is wrong.

Sum of users do not match what is displayed in Google Analytics

I do not know if it is a mistake, but I did a test here in Google Analytics.
I went to Public > Overview, I ran from 09/12/2018 to 11/12/2018. I add the 'points' and in the end gave the result of 106 users, however, just below the graph appears the total, and he reports 102 users.
Detailing:
09/12 - 36 users
10/12 - 34 users
11/12 - 36 users
Total: 106 users.
Is it a bug in the Google Analytics report?
I'm using the Google Analytics API to show the access reports inside the client administration panel, the results reported by the API are correct adding the sum, already on the platform of Google Analytics itself there is this divergence.
this is not a bug. users are reported as the number of users for the whole time period. So if user a user had two visits on 09/12 and 10/12 she would be reported as 1 user for each daily row but only as 1 user for the whole period row
as from API docs:
ga:users
UI Name: Users
The total number of users for the requested time period.

Get sessions info in #google-apis-explorer

I use unique IDs for clients. Once user enters the site, I use google tag manager to save client ID in analytics dimension3.
Once an e-commerce event is triggered, I use google analytics API to request info for that particular user sessions using filter dimension3==XXX (client ID)
For every session of the selected user I want to get from Google Analytics:
When the session started
Landing page
Session duration
Operating system, browser, screen resolution, referrer, medium and some other general parameters.
What I'm looking for is a way to get information like in Google Analytics -> Audience -> User report (where you can see what a particular user was doing).
But as far as I can judge Google Analytics API can provide only summarized info (metrics divided by dimensions). It's more like SELECT GROUP BY statement but I meed more like SELECT WHERE.
Is there a way to get what I need?
PS. I request the following dimensions:
ga:fullReferrer, ga:landingPagePath, ga:operatingSystem, ga:mobileDeviceMarketingName, ga:source, ga:dateHourMinute, ga:dimension3, ga:screenResolution, ga:browser, ga:browserVersion, ga:medium, ga:dateHourMinute, ga:sessionDurationBucket (2 requests in a batch)
The metric I use is: ga:sessions
What I get is not really what I need for I need information on SESSION (eg there were 30 sessions, I need 30 rows in the result, instead I may get 1000 rows result because analytics splits the metrics into dimensions... ))))

Can Google Analytics show me visits by hour?

I am interested in seeing visits on my site broken down by hour - is there any way to generate a report of this in Google Analytics? It appears that all metrics are only broken down by day. Maybe I can get this information through the GA API?
Since Google Analytics was revised the currently accepted answer is no longer available. The current version of Google Analytics will let you view visitors per hour:
Go to the Reporting Tab
Select "Audience"
Select "Overview"
Select "Hourly"
If you're trying to determine total traffic by hour of the day for a given date range then you can use this custom report:
https://www.google.com/analytics/web/permalink?type=custom_report&uid=pToP7693ReSxfSIpbqHmWg
Only a few reports have hour-by-hour data; as far as I know, they're all in the 'Visitors' section.
For example, to see Visits by hour over a period of time, click Visits, Visitor Trending, then Visitors. Then, in the top right of the report, select Graph by: (icon of a clock)
All of the reports under Visitor Trending have hour-by-hour data, except Absolute Unique Visitors.
As far as the API goes, you can check what query combinations are valid here (since there are restrictions): http://code.google.com/apis/analytics/docs/gdata/gdataReferenceDimensionsMetrics.html
According to that, all metrics can be viewed by an hourly dimension except Campaign metrics and Visitor (not to be confused with Visit) metrics.
You can test the query you want to run with the Google Analytics Data Feed Query Explorer
If using a (downloadable, emailable) custom report is an option, you can use the custom report described on http://salman-w.blogspot.com/2012/07/analytics-day-of-week-hour-of-day-report.html
The article tells you to do the following:
Create a custom report with flat table (I am sure it will work with explorer style reports too)
Add the dimension hour (not hour of day)
Add the metric visits, pageviews, etc
Preview

Resources