I mean like, count how many clicks the website since beginning and get their country location.
i already testing Google Analytics API but it requires to input date range, which i want from the beginning but no "Since beginning" or "All data" option available.
will set start date from year 2007 works? any suggestion?
will set start date from year 2007 work
Sure, why shouldn't it. The limit is the number of rows your query returns (10 000 per query. Number of row depends on the number of distinct values for the selected combination of dimensions) and the frequency with which you run your query, not the timeframe selected.
You can test this with the Query Explorer were you can run your metrics/dimension combinations without writing API code, so you can first check if you get the expected results.
Related
I have a Google Analytics event label with high cardinality that I'd like to implement - it is a string that can take on any combination of a finite-but-large number of names in a comma-separated list.
I'm worried mainly about losing data - I found this Analytics Help support page:
https://support.google.com/analytics/answer/1009671?hl=en
...which states:
Reports containing high-cardinality dimensions may be affected by
Analytics system limits, resulting in the creation of a rolled-up
(other) entry in the report to contain the data that exceeds these
limits.
...and am wondering if that would also affect reports without the label included, i.e., reports just looking at unique category/action pairings - would GA still roll-up otherwise-identical into "other" entries if the (undisplayed) labels are different?
Also, am wondering if there would be any hits to performance for similar report types (not looking at labels, just category/action pairings).
Maybe this is just bad practice out of the gate? :)
Google Analytics stores daily, in the processed tables, up to a maximum of 50,000 rows (in Google Analytics 360 the limit increases to 1,000,000 rows, making the problem of data aggregation less frequent). As a result, many combinations of unique dimension values are stored for each table processed every day. If a given table has a larger number of combinations of values of dimensions, Analytics stores the top N values and creates a row of type (other) for the remaining combinations of values.
https://www.analyticstraps.com/valori-raggruppati-in-other-nei-report/
Anyway, I tried a custom report with label and without (same time period) and with label I got (other) while without that dimension I got the actual values.
So the problem you fear does not exist (unless the event action is also high cardinality) :)
I'm trying to get all unique visitors for a selected time period, but I want to filter them by date on the server. However, the sum of unique visitors for each day isn't the number of unique visitors for the time period.
For example:
Monday: 2 unique visitors
Tuesday: 3 unique visitors
The unique visitors for the two days period isn't necessarily 5.
Is there a way to get the results I want using the Google Analytics API (v3)?
You're right that Users aren't additive, so you can't simply add them day by day. There are several ways around this.
The fist and most obvious is that if you've implemented the User-ID you should be able to straight up pull and interrogate the data about which users saw your site on which days.
Another way I've implemented before is to dynamically pull the number of Users from the Google Analytics API whenever you need it. Obviously this only works if you're populating a live web dashboard or similar, but since it's just the one figure you're asking for, it wouldn't slow down the load time by much. Eg. if you're using a dashboarding tool such as Klipfolio, you may be able to define a dynamic data source, and query Google whenever you needthe figure (https://support.klipfolio.com/hc/en-us/articles/216183237-BETA-Working-with-dynamic-data-sources)
You could also limit the number of ways that the data can be interrogated, and calculate all of them. For example, if you only allow users to look at data month-by-month or day-by-day, then you only need those figures.
Finally, you can estimate the figure with reasonable accuracy by splitting it into two parts. New Users are equal to New Sessions (you're only new on your first Session), which is additive, so that figure can be separated out and combined as required.
Then, you could take a rough ratio of new to returning Users (% New Users) from, say, 1 year of data, and use that with the New Users figure to generate an average on any level.
According to Firebase Analytics docs (https://support.google.com/firebase/answer/6317517#active-users), the active number of users is the number of unique users who initiated sessions on a given day. Also according to the docs, every time a session is started an event with session_start name is sent. I am trying to get that metric using BigQuery's export, but my query is giving me different results (15636 on BigQuery, 14908 on FB analytics)
I have also tried converting to different timezones to see if that might be the issue, but no matter which timezone I try I never get the same (or similar) results
Which query should I run to get the same results I get on Firebase Analytics dashboard for active users?
My query is
SELECT EXACT_COUNT_DISTINCT(user_dim.app_info.app_instance_id)
FROM table_date_range([XXXXX.app_events_], timestamp('2016-11-26'), timestamp('2016-11-29'))
WHERE DATE(event_dim.timestamp_micros) = '2016-11-27'
AND event_dim.name ='session_start'
Thanks
Update
After #djabi's answer I changed my query to use user_engagement rather than session_start and it works much better now. Still some minor differences though (they range from under ten to under 50 out of 16K, depending on the date).
I have tried once again using different timezones by playing around with DATE(date_add(event_dim.timestamp_micros,1,'hour')) but I never got the exact number I get on Firebase Analytics dashboard.
The new numbers are good enough to be considered statistically acceptable, but wondering if anyone has a suggestion to improve the query and get exact results?
The current query is:
SELECT
COUNT(*) AS active_users
FROM (
SELECT
COALESCE(user_dim.user_id, user_dim.app_info.app_instance_id) AS user_id
FROM
TABLE_DATE_RANGE([XXXXX.app_events_], TIMESTAMP('2016-11-24'), TIMESTAMP('2016-11-29'))
WHERE
DATE(event_dim.timestamp_micros) = '2016-11-25'
AND event_dim.name ='user_engagement'
GROUP BY
user_id )
Note: At the moment we are not sending user_id, so the COALESCE will always return the app_instance_id, in case anyone was going to suggest that could be the problem
You need to wait for full 3 days for data from offline devices to be uploaded. Your query correctly filter the events based on the event timestamp and you pull data from 3 days but that is only day and half from today and that is enough for all data to be uploaded. Try including 3 days from yesterday.
Also try using user_engagement event instead of session_start. I believe active user count is based on user_engagement and not on session_start events.
Also FB reports take a bit to process so you wight want and check the FB reports the next day.
FB reports are done on the time zone on the account and events are timestamped in UTC so the day in FB reports is different from UTC calendar day. You want to control for that discrepancy as well to get matching numbers.
Sessions are by-default measured after user activity of 10 seconds in the respective app which you can change. Try changing the sessions start time count to the least number possible and then you may arrive at a number closer to what you are expecting.
For Android stats I used:
user_dim.device_info.resettable_device_id
instead of
user_dim.app_info.app_instance_id
and it produced better results.
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.
In the Google Analytics in the Search Engine Optimization there is an option to see all the queries that've been used to find the my page. I would like to create an custom report to compare two different date ranges (e.g. march 2014 compared to June 2014) and i would like to see and compare what was the Average Position/Impressions for one query durring March 2014 and what are the values (average possition/impressions) for the same query for the current date.
Is there such an option in google analytics? or i need to export data from one date range and from another one and then use Excel/Google Spreadsheet to create such a report?
The calendar in which you select your timeframe has a compare option (which works with almost any report in GA). I assume that is what you mean ?