Google analytics 谷歌分析嵌入API-访问“令牌”;请求“被拒绝”;在其他领域

Google analytics 谷歌分析嵌入API-访问“令牌”;请求“被拒绝”;在其他领域,google-analytics,google-analytics-api,Google Analytics,Google Analytics Api,在我的新公司,我不得不用谷歌分析嵌入API调试一个错误。 下面是我想出来的: 我们使用以下API: 在后端,我们使用JSON凭据向O-Auth服务发出请求,以便在前端使用身份验证方法:serverAuth.access\u密钥或clientId的令牌instand 在前端,它在一个域中正常工作 对于针对以下对象的请求:maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1s&callback=xdc.\u je

在我的新公司,我不得不用谷歌分析嵌入API调试一个错误。 下面是我想出来的:

  • 我们使用以下API:
  • 在后端,我们使用JSON凭据向O-Auth服务发出请求,以便在前端使用身份验证方法:serverAuth.access\u密钥或clientId的令牌instand
在前端,它在一个域中正常工作

对于针对以下对象的请求:maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1s&callback=xdc.\u je5rc5&token=XXXXXX我得到了结果:

/**/_xdc_._je5rc5 && _xdc_._je5rc5( [1,null,0] )
第二项要求: maps.googleapis.com/maps/api/js/GeocodeService.Search?4sLondon%20UK&7sUK&9sde DE&callback=xdc.\u 1aw0g9&token=XXXXX 1

Return the Right Response: /**/_xdc_._1aw0g9 && _xdc_._1aw0g9( {
   "results" : [
      {/* Short Version */}
   ],
   "status" : "OK"
}
 )
但同一服务器上具有另一个域的相同请求出现错误:

请求:maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1s&callback=xdc.\u bllk9e&token=XXXXXX

答复:

/**/_xdc_._bllk9e && _xdc_._bllk9e( [0,15,0] )
第二个请求是:maps.googleapis.com/maps/api/js/GeocodeService.Search?4sLondon%20UK&7sUK&9sde DE&callback=xdc.\u 1aw0g9&token=XXXXX

答复:

/**/_xdc_._1aw0g9 && _xdc_._1aw0g9( {
   "error_message" : "Geocoding Service: This service requires an API key.  For more information on authentication and Google Maps Javascript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key",
   "results" : [],
   "status" : "REQUEST_DENIED"
}
 )

也许有人知道我能做什么?

你在谷歌开发者控制台中启用了地图api吗?我想是的,因为在第一个域上它可以工作,但我不确定。我如何检查这一点?它们是否都从google开发者控制台运行相同的客户端id?在我复制的测试用例中,我在本地主机上使用相同的配置。一个使用localhost作为主机名,另一个使用test.local.host。第二个出现了错误你在谷歌开发者控制台中启用了地图api吗?我想是的,因为在第一个域上它可以工作,但我不确定。我如何检查这一点?它们是否都从google开发者控制台运行相同的客户端id?在我复制的测试用例中,我在本地主机上使用相同的配置。一个使用localhost作为主机名,另一个使用test.local.host。第二个得到了错误