I'm trying to retrieve user data from a visitor who has signed in to my site using google + sign in button, but I just end up with the message TypeError: gapi.client is undefined in the javascript console.
Since I could not identify the error I finally copy/pasted the example code from Google, which can be found here: https://developers.google.com/+/web/people/#retrieve_an_authenticated_users_email_address
The only thing I changed was the Client ID (for web applications).
And I STILL get the same error!
Since the example code does not work for me, I'm thinking, maybe my settings in the Google API Console are wrong. I have tried to follow the instructions:
- Google+ API Service is active
- Redirect URIs: none
- JavaScript origins are set to localhost and the actual production
domain.
Have also tried to upload the example code to the production server, just to see if this was a local environment issue, but I still get the same error.