-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdashdemo.html
50 lines (45 loc) · 1.49 KB
/
dashdemo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!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="https://www.google.com/jsapi"></script>
<script src="gadash-1.0.js"></script>
<script src="https://apis.google.com/js/client.js?onload=gadashInit"></script>
<script>
// Configure these parameters before you start.
var API_KEY = '63be1b653ddcc23dc6562dcd9953abc2f3be1f0e ';
var CLIENT_ID = '809144664705-3noitj3d2soobtpss0magsjfi9uf2dri.apps.googleusercontent.com';
var TABLE_ID = 'ga:3825';
// 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>