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 9160011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:38:02+00:00 2026-06-17T13:38:02+00:00

The intention here is to retrieve my google analytics data using the API and

  • 0

The intention here is to retrieve my google analytics data using the API and display it in a web page.

I can authenticate with no problem if I use the “popup” method where essentially this code is called:

gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthResult);

However, I don’t want to have to click “Allow access” whenever I want to view this page. Especially as I intend for this to be viewable by multiple people in a CMS.

Seeing as it’s my Google Analytics account, and I have registered the web application, is there no way of authenticating via javascript on page load without having to display a popup to the user?

  • 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-06-17T13:38:03+00:00Added an answer on June 17, 2026 at 1:38 pm

    by using this code check if user authorized your app

    gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: true}, handleAuthResult);
    

    if you set immidiate true then it will not show popup if false it will show popup to user

    in handleAuthResult

     handleAuthResult = function (authResult) {
    var authorizeButton = document.getElementById('authorize-button');
    if (authResult && !authResult.error) {
        authorizeButton.style.display = 'none';
         // do your processing here
        } else {
        authorizeButton.style.display = 'block';
        authorizeButton.onclick = handleAuthClick;
    }
    

    }

    handleAuthClick = function (event) {
    gapi.auth.authorize({
        client_id: clientId,
        scope: scopes,
        immediate: false
    }, handleAuthResult);
    return false;
    

    }

    i think it will help you

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

Sidebar

Related Questions

I am using Postgresql, when I want to use PDO to retrieve the latest
Okay, so here's a problem I'm running into. I have some classes in my
I am using Python and trying to connect to SFTP and want to retrieve
i am going to call a function which will retrieve some data value from
I've been wondering about the performance characteristics of using CoreData as a data source
My intention here is just to create a corresponding contact when a user signs
My intention here is to have a codeigniter app with a blog under the
From the Transactions doc, second paragraph: The intention here is for the client to
My intention is to create a menu at the top of the page which
Here it says that SimpleCursorAdapter 's API level 1 constructor is deprecated and the

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.