How to track "page views per minute" using Google Analytics Real Time API? - google-analytics

I'm using the Google Analytics Real Time API (https://developers.google.com/analytics/devguides/reporting/realtime/v3/) to track the active visitors per minute. For this, I use the metric rt:activeVisitors. Everything is working fine.
However, I want to track the page views per minute, but I did not find any overview of available metrics.
Is it possible to fetch the current page views?

You can find a list of the Dimensions and metrics available in the RealTime API here : Dimensions & Metrics Reference
It doesnt look like page views is something you can see in the RealTime API

As seen here: https://developers.google.com/analytics/devguides/reporting/realtime/dimsmets/pagetracking
You can use
rt:pageviews
the documentation is not really clear on the time frame. But my experiments seem to hint per minute.

The closest you can get is to use pagePath dimension and have activeVisitors as the basic metric (and the only one available, pretty much).
I don't think there is any real value in having live page view stats, you can find those in real time reports built-in standard GA reporting set anyway.

Related

GA: How much time have my 100 most "obsessed" users spent on my site

Does Google Analytics have enough information to answer the question of how much time have my top 100 users spent on my site? I don't need their user information, I don't care about ID or name which I know it doesn't even have. Just the identification of individual users by the cookie GA uses, and a report of how much time the top 100 loyal users spent on my site.
is such a thing possible at all with GA?
From your comment on Colwin's answer:
I don't need google if I have to track this for GA, I just hoped it already has this information such as "page visit duration" on a per-user, ongoing basis. If I had to feed Google that information myself, I can feed my own database and run analytics on it. Thanks anyway.
The Google analytics sessions is
a group of user interactions with your website that take place within a given time frame. For example a single session can contain multiple page views, events, social interactions, and ecommerce transactions.
Average session duration will be calculated as
total duration of all sessions / number of sessions
I don't think this is available from GA out of the box. But you can build something like this with Custom Dimensions available within GA
This will let you setup and send custom metrics dimensions for users that you can then create reports for.
Google Analytics doesn’t allow you to out in PII but random visitor id's should be fine. You can then compare against your own database outside of GA if needed too.
This will allow tracking the same visitor even without them being logged in to your site.
Sending the custom dimensions could possibly look like this.
ga('send', 'pageview', {
'dimension5': '1234567890'
});
You get 20 free custom dimension slots with GA and 200 with GA 360 -> More info here
I think this article has what you are looking for
https://webanalyticsguy.com/2018/01/18/google-analytics-capture-client-id-reporting-purposes/
It shows how to capture the client id which is a decent way to track a specific user. And goes further to explain how to associate that with a metric, in this case the author uses PageView.
You could change this to Average Session Duration or another metric that gives you a sense of time spent.
I guess that you are looking for something like this:
http://www.analytics-ninja.com/blog/2015/02/real-time-page-google-analytics.html
You can get the counts of the users on your site. You can get the seconds they spent on your website page.
I guess this answer will be helpful too: https://qr.ae/TWpkI0

Visit flow in Google Analytics

We're trying to study the behaviour of users before a transaction by analyzing the visit flow, via Google Analytics API.
We've found two limitations when ordering pages:
API has no an analogous to hits.hitNumber in BigQuery.
We're trying to order by time dimensions. The minimum level is ga:minutes, so when there are two or more pages visited at the same minute, we can't figure out which of them comes first.
Any idea about how to deal with it? Thanks in advance.
There is nothing you can do if you wish to use your current dataset.
However, what you can do, in order to carry out these types of analysis in the future, is to create custom dimensions for sessionId and hitTimeStamp. These are simple to deploy through Google Tag Manager.
A great article how to do this can be found here by Simo Ahava.
That way can you can partition by sessionId and then order by hitTimeStamp to get your ordered page flow.

enabling hourly data in google analytics

I have two view/profiles linked to my google analytics account. I want to fetch the hourly data for the current day, ie
start date:today
end date: today
with a few filters and dimensions.
Now I am getting the response for one view that means it is possible in google analytics, however for the other view its showing all the values as 0- this applies both to the gui and the api.
Can anyone suggest me how to enable it for the other view as well?
You cannot. Google Analytics needs some processing time. It might be that some data appears immediately, especially on small accounts, but it's not guaranteed and not a thing you can "enable" or count on.
Updated: Okay, that was a dumb answer. Still, there is a processing latency event in GA Premium. It is possible to get realtime data, but that's a different API with limited data (the core reporting API might return data, but no guarantees for that).
But I admit, since your problem is that you do not get data for the whole day yor have a different problem. But with a premium account you should be able to contact your account manager/technical support.

Mixable metrics and dimensions in google analytics

I'm doing some complex reports for google analytics and would like to ask you if the following is possible. The client wants to have just organic data for a bunch of metrics. Like pageviews, visitBounceRoutes, etc. The query I ended up with is the following:
https://www.googleapis.com/analytics/v3/data/ga?dimensions=ga:source,ga:medium,ga:keyword,ga:day,ga:month,ga:year&end-date=2013-11-20&fields=columnHeaders/name,rows,totalResults,totalsForAllResults&filters=ga:medium==organic&ids=ga:79067749&metrics=ga:pageviews,ga:pageviewsPerVisit,ga:visitors,ga:avgTimeOnSite,ga:newVisits,ga:visitBounceRate&start-date=2013-10-20
However the response is as follows:
'{"totalResults":0,"columnHeaders":[{"name":"ga:source"},{"name":"ga:medium"},{"name":"ga:keyword"},{"name":"ga:day"},{"name":"ga:month"},{"name":"ga:year"},{"name":"ga:pageviews"},{"name":"ga:pageviewsPerVisit"},{"name":"ga:visitors"},{"name":"ga:avgTimeOnSite"},{"name":"ga:newVisits"},{"name":"ga:visitBounceRate"}],"totalsForAllResults":{"ga:pageviews":"0","ga:pageviewsPerVisit":"0.0","ga:visitors":"0","ga:avgTimeOnSite":"0.0","ga:newVisits":"0","ga:visitBounceRate":"0.0"}}'
Can the dimensions ga:source,ga:medium,ga:keyword be mixed with the above metrics? It seems they can't since if I omit them the API returns an array of values 1 per each day within the specified range.
Where can I find more information about this and what categories are mixable? https://developers.google.com/analytics/devguides/reporting/core/dimsmets just shows all the available metrics but do not explains how they are combined and which one would be valid requests. I'm new at the analytics API and would be great any kind of help or guidance
Thanks a lot
Google Analytics Query Explorer is your friend for playing around with analytics dimensions/metrics/filters ;-)
Try http://ga-dev-tools.appspot.com/explorer/?dimensions=ga:source,ga:medium,ga:keyword,ga:day,ga:month,ga:year&metrics=ga:pageviews,ga:pageviewsPerVisit,ga:visitors,ga:avgTimeOnSite,ga:newVisits,ga:visitBounceRate&filters=ga:medium%253D%253Dorganic&start-date=2013-10-20&end-date=2013-11-20&max-results=100
Some thoughts:
Those dimensions & metrics should work -- maybe there was no organic data recorded during that time range?
Try removing the ga:medium==organic filter and see what your data looks like.
Does the profile you're using (ga:79067749) have any filters on it? If so, maybe try a different profile that has unfiltered data. (Analytics best practices -- make sure you have a profile with no filters applied that captures all data.)
As Mike said, there is no problem with the combination of metrics and dimensions you are using.
If you are entering the URL query directly in the browser problem might be the lack of URL encoding in your query string. For example, you need to convert == to %253D%253D
For example, instead of ga:medium==organic, you need ga:medium%253D%253Dorganic
If you build your query in the Google Analytics Query Explorer as Mike suggests, you can grab the direct link to your report by clicking the link symbol in the upper left:

Google Analytics - Custom Alerts for Real-Time data

I'm looking to create a custom alert to notify me whenever X number of people are on the site at once. This data is already available using the Real-Time reports page. However, this does not seem possible via the Intelligence Events section. From there, I'm only able to create custom alerts based off Day, Week, or Month data. Has anybody found another area of Google Analytics that would make this type of report possible?
Google Analytics have just launched a Beta of their Real Time API which might let you do this: http://techcrunch.com/2013/08/01/google-launches-real-time-api-for-analytics-in-invite-only-beta/
You can use the real-time API for that. It's been possible for quite a few years now. You can find all the documentation for that right here. It's typical OAuth + JSON API.
You can also use a paid service. I built one, Metrics Watch. It really depends of your goal and how critical this is to your business/job. If it's critical, I would highly encourage you to look for a paid service, no matter which one.
Hope that helps!

Resources