Is there anyway to grab Google Analytics via some kind of API? - google-analytics

Basically I have an admin CP I've coded for all my sites and I'd love to integrate the information gathered by Google Analytics on it to avoid having to look at both sites every morning.
BTW I'm using PHP, but I would assume if something like this exists it would just be exported as XML.

Nope.
Here's how to use Yahoo Pipes to scrape your Analytics page
Alternatively, you can export reports and use them

There's an official API in private beta. I'm looking forward to it!
http://analytics.blogspot.com/2008/10/more-enterprise-class-features-added-to.html

Nicolas Lierman has developed an AIR application that uses an API of his own creation to gather Google analytics data. He refuses to puplish the API though as apparently it exposes some severe security flaws in Analytics interface. Google themselves have never published an API for it.
If you really want to proceed with your plan, you'll have to reverse engineer the interface yourself.

Related

Is it possible to integrate Google Analytics in my JS library

I have a JS library which is used by some users. I am going to track some behaviours from user using the library. I tried to configure a property on Google Analytics, however, it seems I should configure a URL for a website, an ID for an ios or an Android application.
How can I use Google Analytics in my library? Or can GA be used for this purpose?
Thanks
Google Analytics is a web analytics tool. So you won't be able to track your JS library with GA.
If you Google “Google Analytics,” the description provided is as following:
Google Analytics lets you measure your advertising ROI and track your Flash, video, and social networking sites and applications.
JS libraries are not part of the use cases.
Also, Google “Track JS Library Google Analytics.” As you can see, you’ll only get references to libraries such as gtag.js or analytics.js, which will not serve your purpose of tracking your library.
And ask yourself, will people use your JS library when they know you are tracking them? I don't think so. Instead, create a repo on GitHub with documentation and allow users to report issues.
Also, create a mailing list with users and execute small surveys to understand better how people are using your JS library.

Google Analytics: tracking offline mobile apps

We're tracking our web apps using GTM (Google Tag Manager) and GA360 (the paid version of GA).
We also have hybrid mobile apps (mobile apps built with web frontend) that are intended for our users to work mostly offline (they are kind of reader apps).
I've been doing some research and there's a lot of information but I'm not sure yet of what's the best approach to connect my mobile apps to GA when they're mostly offline.
I've found Google Analytics for Firebase which is a free service but seems to be a separate service from GA and I would end up with half of the analytics in GA and the other half in Firebase.
I also read about using Workbox to support Offline Google Analytics:
https://developers.google.com/web/tools/workbox/guides/enable-offline-analytics
What's actually the best approach for this kind of problem?
What service(s) can I use to solve this problem?
Thank you.
I'm not sure if either of the other two approaches mentioned above are better or even work in this context, but I wanted to mention a third approach, linked below.
It is not simple, involving writing custom google analytics calls to check online status, and either queue requests yourself when offline, or post them when online.
It should work well though, and end up keeping all of your analytics in one console.
Simo Ahava Blog: Track users who are offline in Google Analytics.

google analytics in asp.net

I am using asp.net 3.5 with C#.
I have registered my application in google analytics and it is successfully showing my statistics. But I want to integrate that statistics into my website, is there any way I can do it.
If you're trying to retrieve Analytics data (rather than collect it, as it sounds like you're already doing), take a look at Google's Data Export API
Have you looked at the Google Analytics API? It's javascript, but you can get that data into server-side code from there.

Data from Google Analytics

So Google Analytics does not have an API that we can use to get our data, so is there an efficient way to programaticly fetch the data collected by Google, without logging it locally?
Edit:
I would prefer a Python or PHP solution but anything will work.
Google just announced that they're making available a data export API for Google Analytics. It sounds like that's exactly what you're looking for.
Per their announcement, the feature's currently in private beta, but I figure it'll be rolled out to all accounts in coming weeks/months. Depending on your needs, you may just want to wait, instead of building a short-term hackish solution.
If you're interested, I presume that the functionality's being rolled out first to members of the Google Analytics Trusted Tester program.
Also, I forgot about this: I never actually completely implemented this for a client because the deal fell through...
But you can customize the dashboard to include the sections of Google Analytics that your report might need and have a scheduled email. If the reports do not need to be too detailed and if Google already aggregates the data in the way you need it, then this might work for you.
The Google Analytics API is now open to everyone and looks like it contains the full data set
Well, it depends on what you want to do with the data. If you only want to process part of it, then I don't think it is difficult.
Here's a basic web search with a hit explanations from Google and someone else:
http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55561
http://blogoscoped.com/archive/2008-01-17-n73.html
There is a completely programmatic way to access the data using greqo(PHP), but the analytics class is in beta. Check it out here.
If beta is not acceptable, you can use a mixture of the XML and Yahoo Pipes to get what you need.
Basic Method
Obtain the tracking data in a usable
format – We can schedule Google
Analytics to email this as an XML file
on a regular basis.
Make the XML file accessible online –
By emailing an attachment to Google
Groups, the file is automatically
given a public URL.
Work out the URL of the most recent
report – Since Google Groups provides
RSS/Atom feeds for all messages, we
can easily find the URL of the most
recent message and therefore work out
the URL of the XML report.
Prepare the data for use – We need to
manipulate the XML and massage it into
a handy JSON format that we can use on
our blog, which can all be done using
Yahoo Pipes.
Taken from here.
I implemented a solution where we scheduled the analytics report to be emailed to a gmail account each day and I pulled the report on demand via POP3. It's pretty easy and works fast. I've heard Epic1 will do this for you as well. I'm researching that now.
If you're using Python, Pandas io is also very helpful. Pandas has an interface on top of the Google Analytics API. It's pretty simple to get up and running and integrates with Pandas so you get the aggregation, time series features, and other data analysis library features.
instructions on how to authenticate and shows examples: http://blog.yhathq.com/posts/pandas-google-analytics.html
more examples: http://quantabee.wordpress.com/2012/12/17/google-analytics-pandas/
I've also posted a few queries to get started
https://github.com/sk8asd123/ga_pandas
Its been a while since I had to deal with this, but Google Analytics has an XML output type, so you can parse that to get the data in your own system. However, I believe that there is no way to get the xml file programatically, so someone still has to go in and generate the file and feed it to your app.
Good question though, I'd love to see if there is a 100% automated solution.
We just released a product - Megalytic - that makes it very easy to create custom reports using data from the Google Analytics API. You can email these reports to others without sharing your Google Analytics account. Also, create links to reports, download as PDF, etc.

Does anyone know a good guide/book to interpreting results from Google Analytics?

I'm looking for a guide to interpreting results from Google Analytics. Also is there an API for accessing the data?
I'm looking for a guide to interpreting results from Google Analytics.
I like Advanced Web Metrics; it's come in quite handy. Recommended if you're at least somewhat familiar with analytics packages in general. Otherwise pick something a little simpler, like Google Analytics 2.0.
Also is there an API for accessing the data?
You can find the API here
Google released an Analytics API on Apr 21, 2009. As usual with Google, there are a few caveats:
It is in "public beta". Everyone can use it, but they reserve the right to modify the API at any time.
Most, but not all metrics and dimensions are available. You can mostly ignore this fact until you start doing advanced combinations.
Read-only access.
They provide full developer documentation and an Analytics API Google Group for discussion.
http://code.google.com/apis/analytics/
Note:
As a new SO user, I can't add any relevant links for this answer, so feel free to edit this post and add them in.

Resources