Universal Google Analytics - grab some statistics to your own site - google-analytics

I am looking for a way, how can I grab some statistics from Google Universal Analytics to my site? Is there any way to display users statistics on site, grabbing from Analytics like below?
Example:
Users today: 10
Week: 70
Month:270
Total: 1500
I found a couple of information from Google, but was not suitable to this topic. All finding results were about old Google Analytics( without upgrading to Universal) and were displaying all statistic results, including Charts.

You can us the Google analytics API to get the stats you are looking for. You will probably end up doing 3 different requests, because of the fact that the request is made by dates. You will have a problem getting the correct count for Today and yesterday, because the Google Analytics data hasn't finished processing yet it normally takes 24 - 48 hours for the numbers to be correct.
Becouse of the fact that you are only looking to see your own data I recommend you look into using service account for authentication.

Related

Track Internal Number of Search Results per search with Google Analytics

This is for a WordPress / WooCommerce setup.
I recently updated my site to Google Analytic 4 and have attempted to setup tracking of search results AND the number of search results per search. I have out-searched Google attempting to find any information on how to set this up...
To be more clear: I have tracking setup to track the search terms users search for and how many times a search term has been searched BUT I'd really like to be able to track how many results are returned when someone searches for something. For example, if someone searches for "Pink Blanket", then I'd like to have a column for Search Results, showing that I have 4 pink blankets for sale on my site.
Why you ask? Let's say over the course of the previous 30 days, I've had 18 searches for "Pinc Blanket" and 32 searches for "Pink Blinket" and 1 search for "Pink Blanke". This would tell me people can't spell correctly and I can use a few of those highly searched terms on my site to return results.
After out-searching Google, I came across this older blog article (https://mixedanalytics.com/blog/number-search-results-google-analytics-gtm/) that does exactly what I want but it's for use with Universal Analytics and not GA4. I tried to set it up for GA4 but no luck as the two versions are quite different. Instead, I reverted back to GA3 / Universal Analytics and attempted the setup but still having issues getting the "Search Results" or the "Avg. Search Results" columns to collect any data:
Does anyone have any idea how to go about doing this?
Ideally, I'd like to get this working with GA4 since Universal Analytics will no longer work come July of 2023.
I feel like this information should be easily obtainable online but perhaps I am not searching for the right answers to my questions.

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.

Google analytics data adjustment?

I've been using a SSIS Integration component to download data from Google Analytics in order to keep an historical view of some websites and track the evolution of them. Basically the metrics we track are Visits (now Sessions) and Visitros (now Users), and the dimensions are Year and Month. However, today I noticed that the data I downloaded for july had a variation on the Users metric. I heard that google analytics uses an estimation method to "calculate" some (if not all) of their metrics, could it be that after that they "adjust" the data with more acurate information? If so, is this mentioned in the documentation? (a link would be highly appreciated) Since the users are complaining that we are not delivering the real GA Data. I tried looked on the Google analytics documentation page with no luck.
Thanks for your time.
PS: Sorry for my english, it isn´t my native language
If you are using the standard version of Google Analytics (you'll know if you are paying $150k for premium), data is sampled depending on volume. Have a read of this article can-you-trust-your-google-analytics-data
I have seen very slightly differing results being returned if you repeatedly call the api with the same historical parameters repeatedly. In my case the figures only differed by 1-2 over a daily set of several thousand, but nevertheless it differed.
If you want to guarantee your results, consider upgrading to premium
Sampling could be an issue if what you are requesting is over 50,000 rows for the time period you are requesting. To avoid it you can download more often, such as daily.
But I think your issue is that there is a processing time for Google Analytics - if you are downloading at 3 am on the 1st it is probable that the processing for the previous day has not finished.
Google Analytics Premium SLA is for 4 hour data freshness, so even that would have trouble. Pragmatically you should allow 24 hours before you download data for the previous day, 48 hours for e-commerce data.
Thirdly make sure it is not Unique Visitors you are requesting, as this is dependent on the time period you are requesting.

Google analytics inconsistency in revenue stats

Google Analytics definitely has a problem in statistic display.
I do query with Date range 14-19 jul:
https://www.dropbox.com/s/fim4avm75ohypqs/gatrust2.png
And have 12 transactions from iOS 5.1.1 and 0 from any others versions which is very strange.
Ok, who knows, maybe there is some abnormal users behavior.
But then i do same request, but for 1 day (18 Jul):
https://www.dropbox.com/s/m0q0lvuvzu4svy5/gatrust1.png
Now there is 6 transactions shown from others versions.
I have feeling that i may meet such inconsistencies in Google Analytics in other queries,
where i just do not see exact inconsistencies proof, but feel that provided information is not logical.
Does it mean, that i can’t trust to information provided by GA?
Just use it as some... sandbox tool?
Confused.
Probably the inconsistencies are caused by Google Analytics sampling. When you have a lot of visits, Google Analytics (free plan) only takes only a part of them to show the corresponding stats.
If you look at the first of your captions, you can see in the upper right a box saying: "This report is based on 248.360 visits (8,36% of sessions)". So you are only seeing data from 8,36% of the real visits. You don't know what the other 91,64% did in that date range.
If you want reliable data with such high number of visits, Google Analytics (free) is probably not your best option. You could use Google Analytics Premium (quite expensive, but eliminates the sampling issue), other paid analytics software or some free alternative like Piwik or Open Web Analytics.

Cost data from Adwords to Analytics in multicurrency is not correct

I have come across quite a peculiar issue. In one of my Google Analytics accounts, I have it linked together with two different Adwords account. All good so far.
The issue is that one of the Adwords accounts is in dollars (which cannot be changed), and the other one in my local currency. Looking at my Google Analytics reports, I am currently seeing the Adwords cost as my local currency for both, which is totally wrong.
Let me give an example:
$1 is, let's say, roughly worth 10 in my local currency.
So, given that I spend $150 in my Adwords account, it would show up as 150SEK in my GA-reports (SEK being my local currency). It should in fact be 1500 since the Adwords spend is in dollars, and there is no conversion done between the two systems with a mismatching currency.
Does anyone know how I can see the correct spend inside my Google Analytics account, seeing as the two Adwords accounts are using different currencies; SEK and dollars?
As far as I know, it imports the value only and will show the currency selected in Analytics. The 150 comes from AdWords, SEK is the currency in Analytics, so it'd show 150SEK.
Not many references in other help forums (I was trying to find some discussion that would help confirm my guess :) but I found this little snippet which mentions that the currency and timezone must match.
GA supports multi-currency however it is only for e-commerce metrics. You could upload data using the Cost Data Upload but "This feature is intended for non-Google paid campaigns. To import Google AdWords data, link your Google AdWords and Google Analytics accounts." All in all you cannot have cost data for two currencies in one view, however you could link the one account to a separate view (with the correct currency setting)

Resources