Reputation: 1344
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.
Upvotes: 1
Views: 99
Reputation: 116868
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.
Upvotes: 1