Search code examples
google-analyticsgoogle-analytics-api

Analytic Dashboard


I am planning to develop a website which will allow registered users to view there analytic data from various sites like Google Analytic in one dashboard, some what similar to http://www.cyfe.com/ which provides all in one dashboard.

I am thinking of two approaches to implement this application.

Approach #1: once the user logins to my web application and request for data, my application would make a call to analytic website using there API (ex Google Analytic API) and display response data.

Approach #2: execute a job which executes for a particular interval (say for every 30 min) and retrieves analytics data for all registered users and saves in my application database. And when user requests data, my application would display the data from application database instead sending request to Analytic website.

Can anyone please suggest the pros/cons of each approach and which one is good to implement?


Solution

  • Remember google analytics data isn't done processing for 24 - 48 hours so requesting data every 30 minutes is over kill the data wont be complete or accurate. Run your application once a day to get data for two days ago.

    The main problem you are going to have is the limit of 7 dimensions and 10 metrics per request. There is no primary key so there is no way of linking data from one request back to the data of another request.

    Another issue you will have is that you can max return 10k rows per request depending upon how many rows are returned by the request you end up making a large number of requests against the API which will be hard on your quota.

    Also you may end up with quota issues you can make a max of 10k requests to each profile per day. once you have hit that quota you will not be able to make any more requests against that profile until the next day. This quota can not be extended.

    You can also make a max of 10 requests a second per user / profile you can tweek this a little using quota user but your application will not be able to run very fast it takes on average half a second for each request to return data. Things are going to take time unless you want to run multiple versions of your extracting application but again it will require you tweek quota user. This quota can not be extended.

    Your application can make a max of 50 k requests against the api a day for all profiles. Once you reach 80% of that quota I recommend you apply for an extension it can take a month or more to get the extension of this quota it is a good idea to plan ahead for this.

    Note: I am the lead developer on a business intelligence application that exports data from Google Analytics into data warehouse application daily I have run into each of those issues. While what you are planning on doing is possible to do you just need to understand the limitations of the google analytics api before you begin your development process.