Search code examples
mysqlgoogle-analyticsgoogle-analytics-api

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.


Solution

  • 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.

    1. the data that you can get is very limited because the data hasn't completed processing. Check dimensions and metrics reference.
    2. 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

    enter image description here