The Report Service returns no data, but when I copy the report in MCC, it does

3 views
Skip to first unread message

AIDevTeam

unread,
Oct 9, 2008, 12:20:11 PM10/9/08
to AdWords API Forum
Hi All,

I suspect I'm missing something minor here, but when I create a report
using the service, no data is returned. However, when I log in to My
Client Center and "create similar report" it returns loads of the
data. Can anyone point out where I'm going wrong?

AccountService AccountService = new AccountService();
AccountService.emailValue = new
PlatformConnectors.Google.Adwords1.email();
AccountService.emailValue.Text = new String[]
{ Settings.Default.AdwordsUsername };
AccountService.passwordValue = new
PlatformConnectors.Google.Adwords1.password();
AccountService.passwordValue.Text = new String[]
{ Settings.Default.AdwordsPassword };
AccountService.useragentValue = new
PlatformConnectors.Google.Adwords1.useragent();
AccountService.useragentValue.Text = new String[] { "PPC Tracking
system. V0.01 (Alpha 2)" };
AccountService.developerTokenValue = new
PlatformConnectors.Google.Adwords1.developerToken();
AccountService.developerTokenValue.Text = new String[]
{ Settings.Default.DeveloperToken };
AccountService.applicationTokenValue = new
PlatformConnectors.Google.Adwords1.applicationToken();
AccountService.applicationTokenValue.Text = new String[]
{ Settings.Default.ApplicationToken };

string[] Accounts = AccountService.getClientAccounts();

ReportService Service = new ReportService();
Service.emailValue = new email();
Service.emailValue.Text = new String[]
{ Settings.Default.AdwordsUsername };
Service.passwordValue = new password();
Service.passwordValue.Text = new String[]
{ Settings.Default.AdwordsPassword };
Service.useragentValue = new useragent();
Service.useragentValue.Text = new String[] { "Tracking system. V0.01
(Alpha 2)" };
Service.developerTokenValue = new developerToken();
Service.developerTokenValue.Text = new String[]
{ Settings.Default.DeveloperToken };
Service.applicationTokenValue = new applicationToken();
Service.applicationTokenValue.Text = new String[]
{ Settings.Default.ApplicationToken };

DefinedReportJob Job = new DefinedReportJob();
Job.name = "Automated Job";
Job.selectedReportType =
ReportTypes.PlacementAndKeywordPerformance; //"Keyword"
Job.startDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month,
DateTime.Now.Day).AddDays(-1);
Job.endDay = Job.startDay;
Job.aggregationTypes = new string[] { AggregationTypes.Summary };
Job.clientEmails = Accounts;
Job.crossClient = true;
Job.selectedColumns = new string[] { ReportColumns.Keyword.Name,
ReportColumns.Clicks.Name }; //"Keyword", "Clicks"

Job.adGroupStatuses = new AdGroupStatus[] { AdGroupStatus.Enabled,
AdGroupStatus.Paused };
Job.campaignStatuses = new CampaignStatus[] { CampaignStatus.Active,
CampaignStatus.Paused };
Job.keywordStatuses = new KeywordStatus[] { KeywordStatus.Active,
KeywordStatus.Paused };

Service.validateReportJob(Job);

long JobId = Service.scheduleReportJob(Job);

...

The response is:

<?xml version="1.0" standalone="yes" ?>
- <report>
- <table>
- <columns>
<column name="keyword" />
<column name="clicks" />
</columns>
<rows />
</table>
- <totals>
<grandtotal clicks="0" />
</totals>
</report>

Jan Piotrowski (AdWords API Guru)

unread,
Oct 9, 2008, 5:15:07 PM10/9/08
to AdWords API Forum
Are you in sandbox mode?

- Jan

AIDevTeam

unread,
Oct 10, 2008, 5:02:17 AM10/10/08
to AdWords API Forum
I'm definately using the live environment. This is evidenced by the
fact that I can see the reports in my MCC Report area.

On Oct 9, 10:15 pm, "Jan Piotrowski (AdWords API Guru)"
> >   </report>- Hide quoted text -
>
> - Show quoted text -

AIDevTeam

unread,
Oct 10, 2008, 5:59:17 AM10/10/08
to AdWords API Forum
Ok, I think I've found what the problem is:

We have multiple clients in our MCC, so as per the instructions, I do
not include a client email in the SOAP header. Instead, I set the
Job.crossClient to true. For some reason, this doesn't return any
data in the XML report. However, when I specifiy a client email in
the SOAP header, it works. I have yet to figure out if all the
keywords are being returned when I specify the client in the SOAP
header.

So, any feedback you have will be most appreciated.

Cheers,
Derek.
> > - Show quoted text -- Hide quoted text -

AdWords API Advisor

unread,
Oct 10, 2008, 3:56:35 PM10/10/08
to AdWords API Forum
Hello Derek,

Well, let me tell you how it's supposed to work. If it doesn't sound
like this is actually how it is working for you, could you follow up
with a SOAP trace of the exact XML you're sending to schedule the
report, with the email/password/token information anonymized?

If you have an MCC account with a bunch of AdWords account underneath
it, and you'd like to run a single report that goes against the
account data in all the AdWords accounts you manage, you should do the
following for the SOAP headers:

- set the "email" SOAP header to the address of the MCC account
- set the "password" SOAP header to the password of the MCC account
- don't set anything for the "clientEmail" SOAP header

And the following for the DefinedReportJob in the SOAP body:

- set the "crossClient" attribute to "true"
- don't set anything for the "clientEmails" attribute (you only need
to set clientEmails if you want to run the report against an [possibly
improper] subset of your client accounts; leaving it out tells the
report service to run the report against all the accounts.)

It's also usually a good idea to include the ExternalCustomerId or
CustomerName column in your cross-client report, so that you can
differentiate the results based on the AdWords account.

Cheers,
-Jeff Posnick, AdWords API Team
Reply all
Reply to author
Forward
0 new messages