Confluence and Google API

Hi all,

I have a script to load google api script:

function loadPicker() {
gapi.load(‘client:auth2’, {‘callback’: onAuthApiLoad});
gapi.load(‘picker’, {‘callback’: onPickerApiLoad});
}

function onAuthApiLoad() {
  
  return true;
}

function onPickerApiLoad() {
  
  return true;
}

$.getScript("https://apis.google.com/js/api.js").done(function() {
	loadPicker();
});

if I use Web developer tool of Chrome to run it, it runs successfully in some page of confluence like user management, … the object google has value but in confluence pages, it fails, the object google is undefined.

fail|690x403

Could you please help me?

Thanks!!

the failed one:

In the Network part of your debugger, can you see if api.js is loading properly?

@nmansilla it’s loading properly. you can paste my script in the question to test.
Thanks!