Keyword report not returning any data, but the web app returns data for the same report

18 views
Skip to first unread message

API User from Z

unread,
Dec 16, 2008, 3:22:37 PM12/16/08
to AdWords API Forum, k...@zazzle.com
I'm having exactly the same problem as discussed in this previous
thread:

http://groups.google.com/group/adwords-api/msg/620c1aeb8c5c498c?hl=en&

I am doing what Jeff said in his last message in that thread, but I am
not getting any data back from the ReportService API. However, I can
run the same report in the Client Report web app and get all the
data. I am setting the startDayand endDay of the job to today's
date. Could that be the cause of the problem? I noticed that the
Client Report web app uses "Today" as the Date Range, but I don't see
a way to do that in the API.

This is how I am setting up the job:

job.name = "Keyword Stats:" + date.Date.ToShortDateString();
job.crossClient = true; // include all accounts in the report
job.startDay = date; // report is for one day
job.endDay = date;
job.selectedReportType = "Keyword";
job.aggregationTypes = new string[] { "Summary" };
job.selectedColumns = new string[] {
"Keyword",
"KeywordDestUrlDisplay",
"FirstPageCpc",
"QualityScore",
"MaximumCPC",
"MaxContentCPC",
"AdGroupMaxCpa",
"PreferredCPC",
"TopPosition",
"BottomPosition",
"Impressions",
"Clicks",
"Cost",
"AveragePosition"
};


And here's what I am getting back:

<?xml version="1.0" standalone="yes"?><report><table><columns><column
name="keyword"></column><column name="firstPageCpc"></column><column
name="qualityScore"></column><column name="maxCpc"></column><column
name="maxContentCpc"></column><column name="preferredCpc"></
column><column name="agMaxCpa"></column><column name="topPosition"></
column><column name="bottomPosition"></column><column
name="kwDestUrl"></column><column name="imps"></column><column
name="clicks"></column><column name="cost"></column><column
name="pos"></column></columns><rows></rows></table><totals><grandtotal
imps="0" clicks="0" cost="0" pos="0.0"></grandtotal></totals></report>

I'd like to do a SOAP trace, but I'm not sure how to do that. Any
pointers would be appreciated.

-Ken

AdWords API Advisor

unread,
Dec 16, 2008, 3:50:11 PM12/16/08
to AdWords API Forum
Hello Ken,

To start with, I wouldn't recommend running a report for the current
day--it's recommended that you wait until at least 6 hours after
midnight in your local timezone before requesting a report for the
previous day. The data you get back for the current day will almost
definitely be incomplete. I wouldn't expect it to be all zeros, like
you're seeing, but as a first step could you try setting the day in
question to yesterday?

In general, though, I think you're running into issues related to the
credentials you're providing in your SOAP request--what I talked about
in my last message in that thread you mentioned. Seeing either the
SOAP request you're making or if you'd rather not post that due the
email addresses, just providing the value of the requestId SOAP
response header from your scheduleReportJob() response would be the
best way to debug that. I can't tell whether you're using .NET or
Java, or whether you're using the official client libraries for each
language. If you are using the client library in one of those
languages, take a look at the README file that comes with it--I
believe it should have an example of how to turn on SOPA logging to
get that info.

Cheers,
-Jeff Posnick, AdWords API Team

API User from Z

unread,
Dec 16, 2008, 7:46:00 PM12/16/08
to AdWords API Forum
Hi Jeff,

Thanks for the pointer to the .Net client libraries. I got the SOAP
trace for my API calls. I pasted them below. I also want to add that
changing the date to yesterday didn't make any difference. I still
got the empty result set. And the whole reason for making these calls
is to get the most up to date data, essentially populate our data cube
with the data from the Client Reports every few hours. Is there
another Web Service I can use for that purpose?

I think security of the API requests is not an issue here, because I
successfully retrieved my usage information using the same HTTP
headers.

Please let me know what I need to change to get the data from my
report requests.

Thanks,
Ken

--------------------------------------------------------
POST /api/adwords/v13/ReportService HTTP/1.0
Host: adwords.google.com
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 2.0.50727.1433)
Content-type: text/xml; charset=utf-8
Content-length: 1730
SOAPAction: "scheduleReportJob"
--------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<applicationToken xmlns="https://adwords.google.com/api/adwords/
v13">APP_TOKEN</applicationToken>
<developerToken xmlns="https://adwords.google.com/api/adwords/
v13">DEV_TOKEN</developerToken>
<email xmlns="https://adwords.google.com/api/adwords/
v13">MY_EMAIL</email>
<password xmlns="https://adwords.google.com/api/adwords/
v13">MY_PASSWORD</password>
<useragent xmlns="https://adwords.google.com/api/adwords/
v13">Zazzle.SEMTools.SEMTracker</useragent>
</soap:Header>
<soap:Body>
<scheduleReportJob xmlns="https://adwords.google.com/api/adwords/
v13">
<job xsi:type="DefinedReportJob">
<endDay>2008-12-15</endDay>
<name>Keyword Stats:12/15/2008</name>
<startDay>2008-12-15</startDay>
<aggregationTypes>Summary</aggregationTypes>
<selectedColumns>Keyword</selectedColumns>
<selectedColumns>KeywordDestUrlDisplay</selectedColumns>
<selectedColumns>FirstPageCpc</selectedColumns>
<selectedColumns>QualityScore</selectedColumns>
<selectedColumns>MaximumCPC</selectedColumns>
<selectedColumns>MaxContentCPC</selectedColumns>
<selectedColumns>AdGroupMaxCpa</selectedColumns>
<selectedColumns>PreferredCPC</selectedColumns>
<selectedColumns>TopPosition</selectedColumns>
<selectedColumns>BottomPosition</selectedColumns>
<selectedColumns>Impressions</selectedColumns>
<selectedColumns>Clicks</selectedColumns>
<selectedColumns>Cost</selectedColumns>
<selectedColumns>AveragePosition</selectedColumns>
<selectedReportType>Keyword</selectedReportType>
</job>
</scheduleReportJob>
</soap:Body>
</soap:Envelope>
--------------------------------------------------------

-----SoapResponse at 12/16/2008 4:01:56 PM-----
Content-type: text/xml; charset=utf-8
Content-length: 1134
SOAPAction: "scheduleReportJob"
--------------------------------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<responseTime soapenv:actor="http://schemas.xmlsoap.org/soap/actor/
next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/
adwords/v13">135</responseTime>
<operations soapenv:actor="http://schemas.xmlsoap.org/soap/actor/
next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/
adwords/v13">1</operations>
<units soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/
adwords/v13">500</units>
<requestId soapenv:actor="http://schemas.xmlsoap.org/soap/actor/
next" soapenv:mustUnderstand="0" xmlns="https://adwords.google.com/api/
adwords/v13">7f046ba7db3749f795c3551d75b67cfd</requestId>
</soapenv:Header>
<soapenv:Body>
<scheduleReportJobResponse xmlns="https://adwords.google.com/api/
adwords/v13">
<scheduleReportJobReturn>606223085</scheduleReportJobReturn>
</scheduleReportJobResponse>
</soapenv:Body>
</soapenv:Envelope>
--------------------------------------------------------


On Dec 16, 12:50 pm, AdWords API Advisor

AdWords API Advisor

unread,
Dec 17, 2008, 10:57:34 AM12/17/08
to AdWords API Forum
Hello Ken,

You're running into one of the more... interesting... aspects of
the .NET client library. To quote from the README:

"In the .NET 1.1 SOAP layer primitive types do not get serialized by
default.
.NET has no way of specifying null for a variable of a primitive type.
If a
primitive type variable is a binding to a SOAP paramer defined in the
WSDL as
nillable="true", in order for the variable to be serialized you need
to set a
variable <parameterName>Specified to true in order for it to be
serialized.
newCampaign.budgetAmount = 1000000L;
newCampaign.budgetAmountSpecified = true;
The members <parameterName>Specified are an artifact of the .NET SOAP
library
and are not present in the original WSDL."

The crossClient attribute of the DefinedReportJob object won't get
properly serialized unless you also set crossClientSpecified to
"true". You can see that it's not present in the SOAP request that
you're sending, and that's causing your empty reports.

On a very related note, I believe that the maintainer of the .NET
client library plans on migrating from the ancient .NET 1.1 WSDL class
generator to the somewhat more recent .NET 2.0 WSDL class generator
with the next major release. This should eliminate the nonsense with
the extra xyzSpecified attributes as well as add a few other niceties.
It also means that if you're still writing your code against the .NET
1.1 runtime you would not be able to use the official client library.
If you're strongly attached to using the .NET 1.1 runtime (e.g.
VisualStudio 2003), then you should speak up and let us know.

Cheers,
-Jeff Posnick, AdWords API Team


API User from Z

unread,
Dec 17, 2008, 2:30:23 PM12/17/08
to AdWords API Forum
Hi Jeff,

That was it! Thank you for pointing that out. I'm using .NET 2.0 so
I would rather you guys switched to 2.0 too.

Going back to this problem. Why didn't the validateReportJob call
catch this problem? It should be an obvious error that it could throw
an exception on.

Thanks again,
Ken

On Dec 17, 7:57 am, AdWords API Advisor <adwordsapiadvi...@google.com>

AdWords API Advisor

unread,
Dec 17, 2008, 4:25:07 PM12/17/08
to AdWords API Forum
Hello Ken,

validateReportJob() will only flag issues that will prevent a report
from being run. For what I assume are legacy reasons, the Report
Center does support running reports directly against MCC accounts (I
think, long ago, you could create campaigns within MCC accounts), so
it didn't get flagged as being invalid. And, in fact, the report ran--
it just didn't have any useful info.

Sorry for the confusion with the .NET client library.

Cheers,
-Jeff Posnick, AdWords API Team


API User from Z

unread,
Dec 17, 2008, 5:53:01 PM12/17/08
to AdWords API Forum
Hi Jeff,

What I meant by my question about validateReportJob is why didn't it
detect the fact that I set crossClient but not crossClientSpecified.
That should be a really easy error condition to detect.

I did have another question about running these reports. You
mentioned in your first reply that I should be running these a day
after the data has been collected. But I need the up-to-date data
during the day. How much can I trust the data I get from the reports
if I call every 6 hours or so? Would specifying the aggregationType
to Daily have a different result than Summary? Should I be calling a
different API altogether?

Thanks again,
Ken

On Dec 17, 1:25 pm, AdWords API Advisor <adwordsapiadvi...@google.com>

AdWords API Advisor

unread,
Dec 17, 2008, 6:22:06 PM12/17/08
to AdWords API Forum
Hello Ken,

validateReportJob() is a server-side call, and it's agnostic to the
client code being used. It just sees the SOAP you send to it. Without
setting crossClientSpecified to true, there is no crossClient SOAP
element in the request you're sending, and that's what
validateReportJob() sees. And it happens that a DefinedReportJob
without the crossClient element is still considered valid.

Up-to-date data throughout the day is really not available. I can't
quantify how much trust you should trust intra-day report data from a
few hours back, other than "not that much". It's not a matter of
setting a different aggregationType and there isn't a different API
that can provide real time data. It's a constraint due to the amount
of time it takes to post-process the impressions and click data
generated by AdWords.

Cheers,
-Jeff Posnick, AdWords API Team


> ...
>
> read more »

API User from Z

unread,
Dec 17, 2008, 6:30:48 PM12/17/08
to AdWords API Forum
Hi Jeff,

I see what you saying about validateReportJob(). About the intra-day
reports, I thought the data I get from the API are the same quality as
those I get from the Clients Reports web app. Are the numbers I've
been getting on the intra-day reports from the web app. also not
dependable? Yikes!

-Ken

On Dec 17, 3:22 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
wrote:
> Hello Ken,
>

AdWords API Advisor

unread,
Dec 18, 2008, 11:27:37 AM12/18/08
to AdWords API Forum
Hello Ken,

Yes, the reports you run via the AdWords API go against the same data
source as reports you run from the web interface. The numbers are not
going to be as accurate as a full-day report that you request the
following day.

Cheers,
-Jeff Posnick, AdWords API Team


Reply all
Reply to author
Forward
0 new messages