Google Analytics:基于位置的印度分析

时间:2016-01-27 06:06:49

标签: api dictionary google-analytics embed city

我想绘制城市明智的印度地图,使用谷歌分析仪表板上显示的Google Analytics Embed API在我们的网站上显示基于位置的分析。我能够绘制国家明智的位置分析图,但它无法为印度绘制城市明智的地图。

<!DOCTYPE html>
<html lang="en">

<script>
(function(w,d,s,g,js,fs){g=w.gapi||(w.gapi={});g.analytics=q:[],
ready:function(f){this.q.push(f);}};
js=d.createElement(s);fs=d.getElementsByTagName(s)[0];
js.src='https://apis.google.com/js/platform.js';
fs.parentNode.insertBefore(js,fs);js.onload=function(
{g.load('analytics');};}(window,document,'script'));
</script>

<div id="chart-1-container"></div>

<script type='text/javascript' src='https://www.google.com/jsapi'></script>

<script>

gapi.analytics.ready(function() {
  gapi.analytics.auth.authorize({
'serverAuth': {
  'access_token': 'ya29.dgL_fhSQYFuYl710ZgtPOOzeZkkRBtPdqHZ3H7-o7mlYlXXXXXXXXXXXXX'
}});

var dataChart1 = new gapi.analytics.googleCharts.DataChart({

query: {
  'ids': 'ga:98XXXXXX', // The Demos & Tools website view.
  'dimensions': 'ga:city',
  'metrics': ['ga:pageviews'],
  'start-date': '7daysAgo',
  'end-date': 'today',
  'sort' : 'ga:pageviews'
},

chart: {
  'container': 'chart-1-container',
  'type': 'GEO',
  'options': {
   'region' : '034'
  }
}
});
dataChart1.execute();
});

</script>
</html>

The image describes the exact solution I wish to have

0 个答案:

没有答案