This doesn't work for me at all;

232 views
Skip to first unread message

Gary McNally

unread,
Jun 13, 2014, 7:46:37 AM6/13/14
to ga-easy-da...@googlegroups.com
Any idea's?


<!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>
    // Configure these parameters before you start.
    var API_KEY = 'AIzaSyBZUihq0ZgJMt_ePszEzGtKuRAbMzwtqQc';
    var TABLE_ID = 'ga:85748298';
    // 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>
<div id=”chart1”></div>
<script>
var chart1 = new gadash.Chart({
  'type': 'LineChart',
  'divContainer': 'chart1',
  'last-n-days':30,
  'query': {
    'ids': TABLE_ID,
    'metrics': 'ga:visitors,ga:visits,ga:pageviews',
    'dimensions': 'ga:date',
    'sort': 'ga:date'
  },
  'chartOptions': {
    hAxis: {title:'Date'},
    vAxis: {title:'Visits'},
  }
}).render();
</script>
</html>

Gary McNally

unread,
Jun 13, 2014, 7:48:54 AM6/13/14
to ga-easy-da...@googlegroups.com
I keep getting an error;

ERRORS:
line-chart-example error: 401 Login Required
chart1 error: 401 Login Required

Joe Erndt

unread,
Jul 8, 2014, 4:25:49 PM7/8/14
to ga-easy-da...@googlegroups.com
Hey gary,
I hope this finds you well. Did you ever figure out why you were getting 
ERRORS:
line-chart-example error: 401 Login Required
chart1 error: 401 Login Required

I am having the same problem. I am just getting started. I will keep looking but if you got this figure out please let me know
Message has been deleted

Андрій Собко

unread,
Sep 15, 2014, 8:00:47 AM9/15/14
to ga-easy-da...@googlegroups.com
how to filx this error?

ERRORS:
line-chart-example error: 401 Login Required
Пʼятниця, 13 червня 2014 р. 14:46:37 UTC+3 користувач Gary McNally написав:

tim worley

unread,
Dec 17, 2014, 12:09:03 AM12/17/14
to ga-easy-da...@googlegroups.com
You have two instances of var chart 1, and each has a different divContainer.

Try changing the first one to var chart 2 etc...
Reply all
Reply to author
Forward
0 new messages