`So, I have set up a system to periodically download an AdWords report across all our accounts/campaigns, and there is an issue with the data. The report field list is:
Account, Day, Campaign, AdGroup, Clicks
All I'm doing is tracking the Clicks per AdGroup per Day, and storing that in our database.
When I run the report through the API for specific date range (7/20 too 7/26, so all in the past), for 2 out of 51 Account/Campaign/AdGroups, I get
a different click count each time I run it. All the other "rows" are stable across runs, just for 2 of them, they change each time. And, on top of that,
these number differ from a similar report run through the Web Manager interface at
adwords.google.com. The two variable AdGroups are in the
same campaign, but there is another AdGroup in that campaign which is stable across runs.
The process I use is:
Build a list of all our accounts:
// Get the service, which loads the required classes.
$managedCustomerService = $user->GetService('ManagedCustomerService', $this->ADWORDS_VERSION);
// Create selector and set up for the fields we want
$selector = new Selector();
$selector->fields = array('CustomerId', 'Name');
// Make the get request.
$graph = $managedCustomerService->get($selector);
if ( isset($graph->entries) )
{
// find which is the parent link. We'll assume only one, cause we're simple-minded
$parent_id = NULL;
foreach ($graph->links as $link)
{
if ( !empty($parent_id) && $parent_id != $link->managerCustomerId )
throw new Exception(" Multiple managers, I can't handle this");
$parent_id = $link->managerCustomerId;
}
// now, walk the entries and produce a list of accounts - anything that doesn't match the parent_id
foreach ($graph->entries as $entry)
{
if ($entry->customerId != $parent_id)
$accountList[$entry->customerId] = $entry->name;
}
}
I then walk that list of accounts, and for each one I set up a ReportDefinitionService for the date range specified, using the selector fields
$selector->fields = array('AccountDescriptiveName', 'Date', 'CampaignName', 'AdGroupName', 'Clicks');
Any idea why just two Campaigns have varying numbers? I have now down my report download 6 times for the same time period, and each time,
the total clicks for these two campaigns varies, while the other 4 are stable.
Thanks,
Andy