他们是否可以使用PHP中的API启用Google Analytics(分析)Google Ads链接中的视图?
以下是Analytics(分析)中的截屏视频:https://www.screencast.com/t/L96GMmgPj9
当前,我正在使用此API。它只会关联Google Ads帐号,而不能打开视图。
// Construct an Google Ads account object.
$adWordsAccount = new Google_Service_Analytics_AdWordsAccount();
$adWordsAccount->setCustomerId("123-456-7890");
// Construct the body of the request.
$adWordsLink = new Google_Service_Analytics_EntityAdWordsLink();
$adWordsLink->setName('Google Ads Link');
$adWordsLink->setAdWordsAccounts(array($adWordsAccount));
try {
$analytics->management_webPropertyAdWordsLinks->insert('123456',
'UA-123456-1', $adWordsLink);
} catch (apiServiceException $e) {
print 'There was an Analytics API service error '
. $e->getCode() . ':' . $e->getMessage();
} catch (apiException $e) {
print 'There was a general API error '
. $e->getCode() . ':' . $e->getMessage();
}