0

簡単なダッシュボード Java スクリプト ライブラリを使用して折れ線グラフを表示していますが、エラー 401 ログインが必要です。Google 開発者コンソールでプロジェクトを作成し、そのキーを生成しました。401 エラー コードは、資格情報が間違っていることを示しています。何が問題なのか教えてください。事前に感謝します。これがこのコードです

<!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" type="text/javascript"></script>
    <script src="gadash-1.0.js" type="text/javascript"></script>
  <script src="https://apis.google.com/js/client.js?onload=gadashInit" type="text/javascript"></script>
  <script type="text/javascript">
        // Configure these parameters before you start.
    var API_KEY = 'AIzaSyA2LNhLKC4yvO9CmYXhp3tKjEvtd9GGZbc';
    var CLIENT_ID = '1096873113711-c8j9vt2ilnh6gbb0rshhfk3j89qv9pb5.apps.googleusercontent.com';
    var TABLE_ID = 'ga:91837123';
    // 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>
4

0 に答える 0