0
只使用Analytics(分析)API,我發現你可以通過指定adwordsCampaignID但是拉的AdWords數據,我無法弄清楚如何檢索當前視圖的adwordsCampaignID或者通過過濾當前視圖的某些屬性來獲取它。在谷歌Analytics(分析)API當前視圖檢索adWordsCampaignID
我在幾十個域中循環,需要拉動每個視圖的adwordsCampaignID將其插入到以下函數中。 一個
function getAdWords(&$analytics, $profileId) {
return $analytics->data_ga->get(
'ga:' . $profileId,
'2014-07-01',
'2014-09-09',
'ga:adClicks,ga:CTR,ga:impressions',
array('dimensions' => 'ga:adwordsCampaignID,ga:adwordsAdGroupID,ga:adGroup,ga:keyword','sort' =>
'-ga:impressions','filters' => 'ga:adwordsCampaignID=='.'8486***','max-results' => '50')
);
}
Something along the lines of $results = getAdwordsCampaignID($analytics);