Google Analytics Reporting API vs Query Parameters - mysql

I am trying to build a centralized dashboard to display information from google analytics. I have researched about reporting API which helps in embedding charts directly form analytics dashboard and also on query parameters to store analytics data in local database such as MySQL. I wanted to know which would be easy to implement and which is more effective. I have more than 300 websites which are monitored on analytics through a single account, So the data is going to be huge. I t would be great if anyone could post a code snippet to access data from analytics and store it in the database. Thanks!

You can use the Google Analytics Reporting API v4, it is the updated version after Core Reporting API. The Query Explorer can help you to identify what data to extract.
There is also another alternative if you want easier data import/export. This Analytics Canvas can do the job.
For reference, see this SO post.

Related

Export my analytics data and put them in a database

I am looking to export the analytics data towards a database sql. Do you know one tools who could help me?
Do you know how I can see on Google analytics the traffic resulting from a particular URL??
Thank you all!
You have several options:
UI export: in the top/right corner of your reports you should have an option to download data in various formats (XLS, CSV...)
API: you can use the reporting API to get it out in a programmatic/automated way
One thing you won't be able to do with the free version no matter what you try:
Reconstruct the entire analytics data: whether with the UI or API, you're limited to querying only 7 dimensions maximum at a time (eg ga:country, ga:deviceCategory etc...), and cannot combine certain dimensions together (no official list available, it's trial and error to find out), whereas there are dozens of dimensions available.
So the question for you becomes:
How much resources do I want to invest into partially reverse-engineering Google Analytics vs. the value it brings me vs. what it would cost to get alternative analytics solutions?
I found a cloud based solution which exports raw google analytics data to MySQL database. Setup is simple, all you need to do is add your Google Analytics connection and a database to which the data needs to be exported.
MySQL, PostgreSQL, SQL Server and BigQuery are the supported destinations. It creates a few custom dimensions in your Google Analytics account and Tag in Google Tag Manager to send hits to Google Analytics. Data is exported from Google Analytics to the selected destination every day.
I have been using it for last three months now. Hope this helps.
Exporting the analytics data is a thorny one.
My understanding is that paid GA usage allows the export of all collected GA data.
But free usage does not.
For free usage, all you are going to be able to do, realistically, is to create a report over your GA data (in Data Studio or Google Sheets) that contains the rows and columns you want, and then collect this information and squirt it into a SQL table. You are also liable to come up against sampling.
Re traffic from particular URL, the news is better: just filter on Hostname and Page.

OpsCenter backend API for generating custom reports

I would like to know if we have any specific api's in OpsCenter which would help in generating custom reports.
The use case is:
I am consolidating reports from different tools like App Dynamics,OpsCenter and others into one csv or excel sheet for which i would require any opscenter api which would allow me to do a backend call which would pull the required info for me from OpsCenter and then i can do some additional stuff and consolidate it along with other data in a csv or excel in an automated way.
Any api which would help me with backend Opscenter calls for reports data would be helpful.
The OpsCenter API is fully documented at http://docs.datastax.com/en/latest-opscenter/opsc/opscApi_g.html
If the kinds of reports you're looking to generate involve metric data, you'll be particularly interested in the new-metrics endpoint: http://docs.datastax.com/en/opscenter/6.0/api/docs/metrics.html#method-get-new-metrics
Otherwise you'll just have to wade through it to find what you're looking for. But the front-end is all driven through those api's, so anything you see in the web-interface can be replicated via the documented apis.

Google Analytics to Tableau - options for middleware DBMS

I work on an advanced web app that stores user activity in Google Analytics. In the current design, the information is transferred from GA to Tableau. But we need to do more filtering and data management than can be done easily with Tableau.
The obvious solution is Google Analytics BigQuery, but we are not going that route for now.
I'm considering another solution: download the results (using the GA API via Python or PHP) into a database which can then be used as a data source for Tableau. So there would be a middle DBMS in between GA and Tableau to manage the data easily.
Has anybody done this successfully? A relational database (e.g. MySQL) is simple enough, but would a NoSQL DBMS (e.g. MongoDB) be a better fit here to avoid any schema changes in the future?

Google Analytics - Retrieve Real Time data to a database

I have been searching alot in the internet and can't find an answer.
Is it possible to retrieve real time data from GA to let's say MSSQL?
I would like to store these data somewhere so i can reuse them in some other applications to view real time data.
Yes the Real-time Google Analytics API lets you request the data for what is currently happening on your site. If memory services its basically the last 5 minutes of data that is returned.
There are a few things you should know.
the data that you can get is very limited because the data hasn't completed processing. Check dimensions and metrics reference.
The Real Time Reporting API, in limited beta, is available for developer preview only. Sign up to access the API.
It normally doesn't take that long to get access and you wont get an email from Google stating you have access. Just try again the next day if it works you are in.
Answer to question in comments:
Before you can request data from a Google API you need to register a project on Google developer console. Once you have done that you can find the project number on the settings page

how to push Google Analytics data into mysql tables

I see many tutos to download GA data to a google spreadsheet and refresh it automatically
but none to export data into mysql table(s)
Is it possible ?
If yes where can i find tutos or a freelancer with skills on this subject
If yes is it possible to store the data of several UA in the same table ?
Thx
Yes, you can do that with the Google Analytics core reporting api and you can use their query explorer to see what data you can pull from it.
Also here is all their libraries and sample code that you can use as a tutorial. As far as hiring someone, I would check out the job board here or odesk.com.
if you don't want to play around with code and development, just go ahead and use Analytics Canvas that provides easy data import via API from Google Analytics, which you can then easily export to SQL / MySQL / any other database. All using simple and intuitive graphic interface.
I usually use another solution that does not require coding — Skyvia tool: Google Analytics and MySQL Integration. It allows me to create a copy of Google Analytics report data in MySQL and keep it up-to-date with little to no configuration efforts. I don’t even need to prepare the schema — Skyvia can automatically create a table for my report data. You can load 10000 records per month for free — this is enough for me.