Google Tag Manager API error quot;Not a valid origin for the client: http://localhost has not been whitelisted for client ID(Google Tag Manager API错误不是客户端的有效来源:http://localhost尚未被列入客户端ID的白名单)
问题描述
我正在尝试使用Google Tag Manager API。有人知道为什么即使我在API凭据页面中将http://localhost
和http://localhost:8080
添加到授权的JavaScript源中,仍在控制台中看到以下错误吗?
详细信息:"不是客户端的有效来源:http://localhost没有 已被列入客户端ID xxxx.apps.googleusercontent.com的白名单。 请转到https://console.developers.google.com/并将其列入白名单 您项目的客户ID的来源。"错误: "idpiframe_Initialization_FAILED"
推荐答案
这绝对可以在本地主机中测试。
1)在您的项目上激活Analytics和Google Tag Manager API
2)创建新的OAuth 2.0客户端凭据
3)在限制部分下添加授权的Java源
4)使用新的客户端ID。
当您使用客户端密钥而不是客户端ID时,通常会出现该问题,请确保您没有将它们混淆。
编辑:尝试清空缓存
这篇关于Google Tag Manager API错误&不是客户端的有效来源:http://localhost尚未被列入客户端ID的白名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!