使用"Google“- PHP客户端库。
同时调用"GetCampaigns.php“/ "ListAccessibleCustomers.php”示例代码。我仍然得到这个错误(下面),但找到了一个解决方案(检查答案)。
错误-
authorization_error: User doesn't have permission to access customer.
Note: If you're accessing a client customer,
the manager's customer id must be set in the 'login-customer-id' header.
See https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid发布于 2022-08-19 20:54:25
Fix -
传递Manager帐户的ID (在我的例子中是test帐户)= $loginCustomerId
->withLoginCustomerId($loginCustomerId)所以在“GoogleAdsClientBuilder”中-
$googleAdsClient = (new GoogleAdsClientBuilder())
->fromFile()
->withOAuth2Credential($oAuth2Credential)
->withLoginCustomerId($loginCustomerId)
->build();https://stackoverflow.com/questions/73422166
复制相似问题