How do I embed a Real-Time Google Analytics Dashboard onto my website?

1.2k views Asked by At

I am developing a dashboard for a client. My client is requesting real-time data in the dashboard. After much searching and reading on google, I see that the real-time dashboard embedding is in BETA. I am signing up for access to the BETA, I am wondering if anyone has any resources available for real-time reporting.

As I understand it, the steps to embedding a dashboard into my site are as follows.

1: Set up HTML frame/container for charts/tables 2: Authorize access to GA Account 3: Query GA through the google api

var mainChart = new gapi.analytics.googleCharts.DataChart({
query: {
  'dimensions': 'ga:browser',
  'metrics': 'ga:sessions',
  'sort': '-ga:sessions',
  'max-results': '6'
},
chart: {
  type: 'TABLE',
  container: 'main-chart-container',
  options: {
    width: '100%'
  }
}

});

4: Run/Test/Debug

My question pertains to grabbing real-time data from GA. There doesn't seem to be a solid answer on the web at the moment. Ideally I would like to implement this in javascript. However if the solution is written in PHP, I am not going to complain.

1

There are 1 answers

0
Mohamed Sherif Noureldin On

Well i think its better to put google in a iframe on tour website and hopefully this will be better , faster and easier and with customization of the iframe itself you might mkae it look cool to the customer while the user will be working with all the updates that google add and new features cause he will be actually acting with google