I'm doing this request in Python / Postman:
https://www.googleapis.com/analytics/v3/data/mcf?
ids=ga:xxxx&metrics=
mcf:assistedConversions&
dimensions=&
start-date=2011-10-01&
end-date=2011-10-31
But I only seem to be able to get the total number of results.
1/ Can I get it on a daily granularity? I know that GA API has the ga:date optional parameter, but this does not work in combination with the MCF API and I couldn't find anything similar for MCF.
Do I have to iterate through each day to get the results at a daily granularity?
2/ Is the 30 days lookback applied to API calls? If just put the end date 4 years ahead, will it give me the full results?
Daily granularity: You should add the mcf:nthDay dimension to break the results down into individual days within the specified range:
Index for each day in the specified date range. Index for the first
day (i.e., start-date) in the date range is 0, 1 for the second day,
and so on.
Loopback time: yes it's 30 days and can'be be changed:
Note: The Multi-Channel Funnels Reporting API uses a non-adjustable
30-day lookback window.
If just put the end date 4 years ahead, will it give me the full results?
Why don't you test to find out and let us know :) ?
Related
I would like to retrieve historical travel times from HERE API.
Following the API documentation for 'Calculate Route', I requested travel times for a fixed route at a fixed departure time for different days in the past, using mode=fastest;car;traffic:enabled.
The result is the same route every day and a weekday pattern (i.e., same travel time each Monday) for travel times. This obviously does not include actual traffic conditions on the specified day.
From the documentation, I would have expected to get specific travel times for each day in the past (up to one year).
Did I miss something or is this just not possible?
Thanks a lot for any help!
It is not possible to get the exact route for a past date. For any date other than NOW(current time), the route is calculated with the accumulated historical data taking into consideration the week day, time of the day, any construction work etc.
In the REAL-TIME / Overview page, you can see how much people are currently browsing your site. Although, how do you know if this current value is good or bad? I would like to know how much people were browsing my site the same time the day before, so I would know if I have 5% more or less people.
Also, how would I know if the site is doing it better or worse than 1, 2 or 5 hours before? The REAL-TIME shows the last 30 minutes of per minute page-views, but how do I know if the site is going down or up compared to a few hours before? 30 minutes is not enough.
Is there any add-on to add, custom modification to make, or free/paid service to complement?
You want to use the standard ("core") reporting. The dimensions that will help you are (UI / API):
Hour / ga:hour: A two-digit hour of the day ranging from 00-23 in the timezone configured for the account. This value is also corrected for daylight savings time. If the timezone follows daylight savings time, there will be an apparent bump in the number of sessions during the changeover hour (e.g., between 1:00 and 2:00) for the day per year when that hour repeats. A corresponding hour with zero sessions will occur at the opposite changeover. (Google Analytics does not track user time more precisely than hours.)
Hour of day / ga:dateHour: Combined values of ga:date and ga:hour formated as YYYYMMDDHH
Date Hour and Minute / ga:dateHourMinute: Combined values of ga:date, ga:hour and ga:minute formated as YYYYMMDDHHMM
Hour Index / ga:nthHour: The index for each hour in the specified date range. The index for the first hour of the first day (i.e., start-date) in the date range is 0, for the next hour 1, and so on
With the UI you can add a secondary dimension to reports or build custom reports, with the API you can need to build your requests from scratch (try the explorer, official API doc).
I am tracking a number of events on a website and am trying to extract some analytics data via the api. The problem I have found can be boiled down to this scenario. If I want to know how many unique events have happened per day, I can run a query such as:
?start-date=2016-02-19&end-date=2016-02-24&metrics=ga%3AuniqueEvents&dimensions=ga%3Adate
which will give me table of the number of unique events per day from Feb 19th to Feb 24th. In my specific example, I will have a row that say I had 12914 unique events on Feb 22nd.
If I now change the time period for the query to something like this:
?start-date=2016-02-01&end-date=2016-05-01&metrics=ga%3AuniqueEvents&dimensions=ga%3Adate
I will basically get the same table, only from Feb 1st to Mai 1st. Was suprises me though is, that now the column for Feb 22nd reads 12966 events, while my assumption would be, that this number should actually stay the same.
Is there something I'm missing here? In which scenario would these numbers make sense? Thanks for your help!
Check the API response for the value of containsSampledData.
Sampling is the practice of selecting a subset of data from your traffic and reporting on the trends available in that sample set.
You can specify the sampling level to use for a request by setting the samplingLevel parameter to HIGHER_PRECISION.
You can also try simplifying your request by shortening the date range, or requesting fewer dimensions.
i am working on an application that uses the Google Analytics Export API and i am trying to get the "Trend" result that Google shows against each of your site accounts as a percentage
ie UP 35.04% or DOWN 16.02%
How/where do they get this figure and is it available in the API somewhere.
i have tried comparing averages of last month to this month/first week of the period vs last week of the period etc, but i cannot seem to get the same numbers that Google provides.
any ideas?
thanks in advance
Doug
The formula is pretty simple (excluding today's data):
(Visits over the last 30 days - Visits
between 31 and 60 days ago) / (Visits
between 31 and and 60 days ago).
You can see it in action in the interface if you go to the default dashboard, where it shows you the last 30 days, then on the calendar, click "Compare to past" and select the default amount. It'll show you the numbers used for each calculation and the calculations as they appears in that account list.
The API does not, however, expose pre-calculated numbers (for example, they don't compute bounce rate for you; they just give you the pieces for it.)
So, you'd need to do two API requests to get this data. One for ga:visits in the last 30 days, and then one for ga:visits in the 30 days prior.
Then, when you get it, just subtract, divide, and multiply by 100, and you'll have the percent you're looking for.
UPDATE: The striked out part of the answer was true, but is no longer. The newest version of the Google Analytics API does provide access to some pre-calculated values.
GA Unique Visitors data isn't making sense to me. From the GA FAQ we get the following definition for 'Visits vs. Visitors'
"The initial session by a user during any given date range is considered to be an additional visit and an additional visitor. Any future sessions from the same user during the selected time period are counted as additional visits, but not as additional visitors. "
The part that I can't resolve with the GA graph is "Any future sessions from the same user during the selected time period are counted as additional visits, but not as additional visitors". For the graph below covering a 30-day period, I would understand the GA definition to mean that the data represents uniqueness across all 30 days, right? But if you look at the screen shot below, you see a regular pattern for each week over the 30-day period the report covers. From that, it seems the numbers we are seeing associated with each of the days of the graph (e.g. 3.92% (4142) for Tuesday, September 8) is a count of unique visitors just in the context of that one day - i.e. without correlating their uniqueness to the rest of the days in the 30-day period. If the graph actually showed uniqueness across the 30-day period, I would expect the daily numbers to start high in the early days of the period and decrease over the 30-day period as the number of already-seen visitors (i.e. returning visitors) increases, no?
What am I missing here?
UPDATE
Helpful clue from Jonathan S. below got me on the right track.
I think I understand now what the daily bar graph values mean, but it's a little counter-intuitive and I'd bet not what some others might be assuming as well. The reports states "39,822 Absolute Unique Visitors" at the top, which means just that: over the 30-day period we saw this many uniques. Fair enough. The confusing part is that the daily (or weekly) bar values in the graph below are not mutually exclusive uniques as I had assumed, but are values relative only to the 39,822 total - i.e. there is overlap between the unique visitor counts across any group of days. This means the sum of the daily % values > 100% and the sum of the daily count values > 39,822. The algorithm is: when you visit for the first time in the 30-day period, call that "today", you add 1 to the total (39,822) and 1 to the "today" bar value. When you show up again "tomorrow", you are NOT counted again in the total, but ARE counted as 1 in the "tomorrow" bar value.
alt text http://img.skitch.com/20090922-djti81ejj5gqn575ibf8cj1e8x.jpg
I believe it's just an issue of grouping. The top right of the graph has 3 icons to group by day, week, or month. It's currently grouping by day. So if I visit your site today and come back tomorrow, I'll be counted once for each day.
I tried looking at the month view for one of my sites but it didn't give me much meaningful data. I believe the above should answer your original confusion though.
Is it possible that you're searching for something what isn't existing anymore? Unique Visitors/Visits is old terminology. Check: https://www.seroundtable.com/google-analytics-sessions-users-18424.html
Then check how sessions and users are defined:
Sessions ("ex-visits", it's very detailed): https://support.google.com/analytics/answer/2731565?hl=en&ref_topic=1012046
Users in Google Analytics reporting are defined as "Users who have initiated at least one session during the date range". So IMHO it's not about 30 days, it's about the SELECTED date range.
I hope this helps.