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?
by using this code check if user authorized your app
if you set immidiate true then it will not show popup if false it will show popup to user
in handleAuthResult
}
}
i think it will help you