1
votes

I'm trying to get started using the Google Tag Manager API. Does anyone know why I'm seeing the following error in my console even though I have added http://localhost and http://localhost:8080 to the Authorised JavaScript origins in the API Credentials page?

details: "Not a valid origin for the client: http://localhost has not been whitelisted for client ID xxxx.apps.googleusercontent.com . Please go to https://console.developers.google.com/ and whitelist this origin for your project's client ID." error: "idpiframe_initialization_failed"

1

1 Answers

4
votes

This is absolute possible to test in localhost.

1) Activate both Analytics and Google Tag Manager APIs on your project
2) Create new OAUTH 2.0 client credentials
3) Add the Authorized Javascript Origins under Restrictions section
4) Use the new client id.

The problem often occurs when you use client key instead of client id, make sure youre not mixing em.

Edit: Try to empty cache