Hi Nick,
Since, there is no one actively replying here. I am directly sending my query to you.
<!DOCTYPE>
<html>
<head>
<title>GA Dash Demo</title>
</head>
<body>
<!-- Add Google Analytics authorization button -->
<button id="authorize-button" style="visibility: hidden">
Authorize Analytics</button>
<!-- Div element where the Line Chart will be placed -->
<div id='line-chart-example'>
</div>
<!-- Load all Google JS libraries -->
<script src="gadash-1.0.js"></script>
<script>
// Configure these parameters before you start.
var API_KEY = 'AIzaSyDV71YX3cJOHPZjd_h0p4bhYbuGS6xVpE0';
var TABLE_ID = 'ga:87320501';
// Format of table ID is ga:xxx where xxx is the profile ID.
gadash.configKeys({
'apiKey': API_KEY,
'clientId': CLIENT_ID
});
// Create a new Chart that queries visitors for the last 30 days and plots
// visualizes in a line chart.
var chart1 = new gadash.Chart({
'type': 'LineChart',
'divContainer': 'line-chart-example',
'last-n-days': 30,
'query': {
'ids': TABLE_ID,
'metrics': 'ga:visitors',
'dimensions': 'ga:date'
},
'chartOptions': {
height: 600,
title: 'Visits in January 2011',
hAxis: { title: 'Date' },
vAxis: { title: 'Visits' },
curveType: 'function'
}
}).render();
</script>
</body>
</html>
I have well written(copied and pasted) clientID and api keys from Google Api console, but I am unable to see report on my browser, instead it shows:
I have some projects created on Google Api Console earlier (6 months back) apart from the project whose client ID and API keys are used in above code. If I use client ID and api keys of previously created project it works fine.
Any quick help appreciated.
Thanks,
Balaji