I have been trying to use Google Analytics Core Reporting API with JavaScript.
I am new to it and I was trying to use the sample code provided by google for core_reporting_api_v3.
But after the core_reporting_api_v3.html file is ran it calls auth_util.js.
Code from auth_utils.js:
function checkAuth()
{
gapi.auth.authorize({client_id: clientId, scope: scopes}, handleAuthResult);
}
function handleAuthResult(authResult)
{
alert("made it");
if (authResult)
{
gapi.client.load('analytics', 'v3', handleAuthorized);
}
else
{
handleUnAuthorized();
}
Here in checkAuth() function there is a call made to google api gapi.auth.authorize with the client Id, scopes, immediate(tried for both :true/false) and callback function. And it should pop-up an authorization window for user authorization. After that the callback function is called.
But this pop-up window never appears. Please help me with this, I am not getting what the problem is. One might think the problem is with credentials but I am using the same credentials using python and getting the results successfully. Is there any way I can track the process going behind in the browser like: what call is being made and where is the process getting stuck? Is there any tutorial for writing this gapi.auth.authorize call in raw form in javascript as a REST API?