简体   繁体   中英

Google Analytics API 500 internal error during AdWords link creation

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)

From Account management

Write operations in the Management API (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM