Google Analytics API 500 internal error during AdWords link creation

天大地大妈咪最大 提交于 2020-02-24 14:58:48

问题


I'm getting Error :

"code":500,"message":"There was an internal error."

exception every time I'm trying to link Google analytics to Adwords via Analytics Management API.

Code is pretty straightforward (PHP), just like documentation example:

$adwordsAccounts = [];

foreach ($adwordsAccountIds as $customerId) {  
    $adwordsAccount = new \Google_Service_Analytics_AdWordsAccount();
    $adwordsAccount->setCustomerId($customerId);
    $adwordsAccount->setAutoTaggingEnabled(true);
    $adwordsAccounts[] = $adwordsAccount;
}

$adWordsLink = new \Google_Service_Analytics_EntityAdWordsLink();
$adWordsLink->setName('AdWords Link');
$adWordsLink->setAdWordsAccounts($adwordsAccounts);

$response = $client->management_webPropertyAdWordsLinks->insert($accountId, $webPropertyId, $adWordsLink);

google-api-php-client library version is latest (2.2.0)


回答1:


From Account management

Write operations in the Management API (e.g. create, update, delete, patch) for Web Property, View (Profile), and Goal resources are currently available as a developer preview in limited beta. If you're interested in using these features, request access to the beta.

Unless i am mistaken you have not applied for access to the beta program. Note it can take up to a month to get access you will hear from Google if you have been granted access.

Assuming that you have applied for beta.

There appears to be a bug in this currently the bug log can be found here. Google has been notified we will have to wait for them to fix it.



来源:https://stackoverflow.com/questions/46764027/google-analytics-api-500-internal-error-during-adwords-link-creation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!