Google Analytics API in Javascript
<p>I am using the Google Analytics Javascript library to let users view a GeoMap of the particular page they are on. However, everytime they attempt to do so, thye have to go through an authentication process only to have my data displayed on my page. How can I find an alternative to this. I only want to embed my Analytics data through a visualized graph on my page so that all anonymous viewers can see it</p>

<hr>

<p>**We have created an account in Google analytics.
Now we are able to get the statistics of the site.
Open the site <a href="http://Example.com" rel="nofollow">http://Example.com</a>
Click on Authorize Analytics button.
 Provide the credentials of the Google account in the opened window.
Username: xxxx@gmail.com Password: xxx
It will redirect to <a href="http://Example.com" rel="nofollow">http://Example.com</a> page.
Enter the table id ga:61737784 and click on Draw Charts Button, then u will get the statistics for the site.</p>

<p>My requirement is without login in to Google analytics site I should get the statistics.
Because the end user don’t know the credentials of Google analytics.
The below is the html and javascript code.**          </p>

<pre><code>  &lt;script src="http://apis.google.com/js/client.js?onload=gadashInit" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="http://analytics-api-samples.googlecode.com/svn/trunk/src/reporting/javascript/ez-ga-dash/gadash-1.0.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="http://www.google.com/jsapi" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="http://www.google-analytics.com/ga.js" type="text/javascript"&gt;&lt;/script&gt;

    &lt;script type="text/javascript"&gt;
      gadash.configKeys({
        'apiKey': xxxxx',
        'clientId':xxxxx'
      }); 
      var dataOverTime = new gadash.Chart();
      var scoreCard = new gadash.Chart();
      var sourceMediumTable = new gadash.Chart(); 
      var baseConfig = {
        'last-n-days': 30,
        'query': {
          'metrics': 'ga:visitors, ga:visits, ga:pageviews',
        },
        'chartOptions': {
          width: 400
        }
      }; 
      var dataOverTimeConfig = {
        'divContainer': 'dataOverTimeConfig',
        'type': 'LineChart',
        'query': {
          'dimensions': 'ga:date',
          'sort': 'ga:date'
        },
        'chartOptions': {
          height: 250,
          legend: {position: 'bottom'},
          hAxis: {title:'Date'},
          curveType: 'function'
        }
      }; 
      var scoreCardConfig = {
        'divContainer': 'scorecard',
      }; 
      var sourceMediumTableConfig = {
        'divContainer': 'sourceMediumTableConfig',
        'query': {
          'dimensions': 'ga:source,ga:medium',
          'sort': '-ga:visitors',
          'max-results': 100
        }
      };
      function renderGraph() {

         baseConfig.query.ids = document.getElementById('tableId').value;

         dataOverTime.set(baseConfig).set(dataOverTimeConfig).render();

         scoreCard.set(baseConfig).set(scoreCardConfig).render();
    sourceMediumTable.set(baseConfig).set(sourceMediumTableConfig).render();   

         document.getElementById('ui').style.display = 'block';

    return false;
       }
        &lt;/script&gt;
    &lt;script type="text/javascript"&gt;

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-33166458-1']);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

    &lt;/script&gt;
    &lt;script type="text/javascript"&gt;

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-32934024-1']);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google.com/jsapi';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

    &lt;/script&gt;
        &lt;script type="text/javascript"&gt;

          var _gaq = _gaq || [];
          _gaq.push(['_setAccount', 'UA-32934024-1']);
          _gaq.push(['_trackPageview']);

          (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://') + 'analytics-api-samples.googlecode.com/svn/trunk/src/reporting/javascript/ez-ga-dash/gadash-1.0.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
          })();

        &lt;/script&gt;
        &lt;script type="text/javascript"&gt;

          var _gaq = _gaq || [];
          _gaq.push(['_setAccount', 'UA-32934024-1']);
          _gaq.push(['_trackPageview']);

          (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://') + 'apis.google.com/js/client.js?onload=gadashInit';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
          })();

        &lt;/script&gt;
        &lt;button id="Button1" style="visibility: hidden;"&gt;
        Authorize Analytics&lt;/button&gt;
        &lt;hr /&gt;
        &lt;p&gt;
        Enter your Table ID:
        &lt;input type="text" id="tableId" /&gt;
        &lt;button onclick="return renderGraph()"&gt;
        Draw Charts&lt;/button&gt;&lt;/p&gt;
        &lt;hr /&gt;
        &lt;div id="ui" style="display: none;"&gt;
        &lt;h4&gt;
        Data Over Time&lt;/h4&gt;
        &lt;div id="dataOverTimeConfig"&gt;
        &lt;/div&gt;
        &lt;h5&gt;
        Totals for each metric&lt;/h5&gt;
        &lt;div id="scorecard"&gt;
        &lt;/div&gt;
        &lt;h5&gt;
        Source and Mediums by Visitor&lt;/h5&gt;
        &lt;div id="sourceMediumTableConfig"&gt;
        &lt;/div&gt;
</code></pre>
