Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7020493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:19:34+00:00 2026-05-27T23:19:34+00:00

I am using the Google Analytics Javascript library to let users view a GeoMap

  • 0

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. This is the code where the process takes place.

   google.setOnLoadCallback(init); 
    /**
    * This is called once the Google Data JavaScript library has been loaded.
    * It creates a new AnalyticsService object, adds a click handler to the
    * authentication button and updates the button text depending on the status.
    */
    function init() 
    {
      myService = new google.gdata.analytics.AnalyticsService('charts_sample');

     /*
       this is essentially the line I want to replace. It anonymously 
       tries to access my viewer's account.I want to set this scope such as it 
       address the  URI of my Analytics account       
     */            

      scope = 'https://www.google.com/analytics/feeds'; 

     /*
       if the above scope is altered to my URI then the below unnecessary login
       steps will not be required at all. This is the reason why my viewers are
       taken to their analytics page which is fundamentally non-existent.
     */   

      $("authButton").onclick = function() {
        // Test if the user is not authenticated.
       if (!google.accounts.user.checkLogin(scope)) 
         {
           // Authenticate the user.
            google.accounts.user.login(scope); 
         } else 
         {
          // Log the user out.
           google.accounts.user.logout();
           getStatus();
         }
      }
     getStatus(); 
  } 

  // gets the account data and then gets the outputs of the requested query              

   function getStatus() 
   {
      getAccountFeed();
      getDataFeed();
   }


   function getAccountFeed() 
   {
      //Here agsain, I want to modify it access my account's URI  
      var myFeedUri ='https://www.google.com/analytics/feeds/accounts/default?max-results=50';
      myService.getAccountFeed(myFeedUri, handleAccountFeed, handleError);
  }

  function getDataFeed() 
  { 
   var myMapPopularityFeedUri = 'https://www.google.com/analytics/feeds/data?ids=ga%3A53482361&dimensions=ga%3ApagePath%2Cga%3Acity%2Cga%3Acountry%2Cga%3Aregion%2Cga%3Alongitude%2Cga%3Alatitude&metrics=ga%3Avisitors&start-date=2011-12-01&end-date=2011-12-25&max-results=50';

  myService.getDataFeed(myMapPopularityFeedUri, handleDataFeed, handleError);  
 }   

Help will be appreciated a lot. Please don’t be too critical. Its my first question here. Instead let me know and I will make for my amendments.

Here is a screenshot of what the embed looks like upon my own click, i.e, after GA has
fetched my own data through my account. The geoMap is at the bottom of the page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:19:35+00:00Added an answer on May 27, 2026 at 11:19 pm

    It seems the best way is creating of the separate shared (public) feed (report) in Analytics.
    Just feed security requires authorization login to view or receive data if the feed (report) was created under personal credentials … independently to what version OAuth or OAuth2 is used, just if you use request to view data on the site you should use at least API key (for public reports) OR OAuth credentials for personal reports.

    look this guide:
    Loading an API and Making a Request

    or choose any other example from this page:
    Google Analytics: Core Reporting API Client Libraries & Sample Code (v3)

    Use this nice tool also:
    OAuth 2.0 Playground

    Generate API key for maps:
    Google Maps API Family

    Google Maps JS API tutorial:
    Google Maps JavaScript API V3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET website set up, and I'm using Google Analytics for page
I'm using GAPI library (in PHP) for querying Google Analytics API. I request 2
Google Analytics tracks users through a client-side javascript that customers place on their site.
I need to record a page view using analytics for a certain url with
I'm using Google Analytics to track eCommerce. The checkout page is is dynamic with
I was using the below code provided by Google for Google Analytics. <script type=text/javascript>
Currently using Google Analytics as a supplement to our paid tracking software, but neither
I am using Google Analytics on an ajax heavy website. I have a timer
I am using google analytics in my app to track each pages. I am
Is there anyway, using google analytics, to track a user's journey/selections through a long

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.