Using only the Analytics API, I've discovered you can pull Adwords data by specifying the adwordsCampaignID However, I cannot figure out how to retrieve the adwordsCampaignID of the current view, or alternately, to get it by filtering on some property of the current view.
I cycle through several dozen domains and need to pull the adwordsCampaignID of each view & insert it into the following function. a
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);