why keyword performance report different result by comparing results from HTTP Request and directly from mcc

146 views
Skip to first unread message

Minius

unread,
Jun 13, 2012, 3:11:27 AM6/13/12
to adwor...@googlegroups.com, mind...@lits.lt
Hi,

I try to get keyword performance report by fallowing this specification:
https://developers.google.com/adwords/api/docs/guides/reporting?hl=lt.

Everything works fine, except that result are different by comparing with results directly from MCC.
Totals of fallowing field:
clicks, cost
are different than from MCC form the same client and same data range.
Result from MCC
is slightly larger than result from http request using AdHoc method.

Why?
Maybe someone you have suggestions on what to pay attention, or what might be wrong ?

My code looks like:
// Account login details
    $username = "xxx";
    $password = "xxx";
    $customerId = "xxx"; 
    $devToken = "xxx";
     
    // Get an access code for the user
    $url = "https://www.google.com/accounts/ClientLogin";
    $params = array(
        "accountType" => "GOOGLE",
        "Email" => $username,
        "Passwd" => $password,
        "service" => "adwords",
        "source" => "test"
    );
     
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
    //curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $curlData = curl_exec($curl);
    curl_close($curl);
     
    // Parse the response
    $curlData = explode("\n", $curlData);
    $return = array();
    foreach ($curlData as $value) {
        $value = explode("=", $value, 2);
        if (count($value) > 1) {
            $return[$value[0]] = $value[1];
        }
    }
    // Extract the access token
    $authToken = $return["Auth"];
   
   
    #
    $httpHeaders = array(
        "Authorization: GoogleLogin auth=$authToken",
        "clientCustomerId: $customerId",
        "developerToken: $devToken"
    );
   
    #
    $reportDefinition = "<reportDefinition>";
    $reportDefinition .= "<selector>";
    $reportDefinition .= "<fields>Id</fields>";
    $reportDefinition .= "<fields>Date</fields>";
    $reportDefinition .= "<fields>ExternalCustomerId</fields>";
    $reportDefinition .= "<fields>AccountDescriptiveName</fields>";
    $reportDefinition .= "<fields>CampaignId</fields>";
    $reportDefinition .= "<fields>Clicks</fields>";
    $reportDefinition .= "<fields>AverageCpc</fields>";
    $reportDefinition .= "<fields>Cost</fields>";
    $reportDefinition .= "</selector>";
    $reportDefinition .= "<reportName>Keywords Performance Report</reportName>";
    $reportDefinition .= "<reportType>KEYWORDS_PERFORMANCE_REPORT</reportType>";
    $reportDefinition .= "<dateRangeType>LAST_MONTH</dateRangeType>";
    //$reportDefinition .= "<dateRangeType>CUSTOM_DATE</dateRangeType>";
    $reportDefinition .= "<downloadFormat>CSV</downloadFormat>";
    $reportDefinition .= "<includeZeroImpressions>true</includeZeroImpressions>";
    $reportDefinition .= "</reportDefinition>";
     
    $params = array("__rdxml" => $reportDefinition);
   
   
    #
    $url = "https://adwords.google.com/api/adwords/reportdownload/v201109";
 
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $httpHeaders);
    //curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $reportData = curl_exec($curl);
    curl_close($curl);
     
    print "$reportData\n";


Minius

unread,
Jun 18, 2012, 5:05:51 AM6/18/12
to adwor...@googlegroups.com, mind...@lits.lt
can someone look at my problem? Please

Danial Klimkin

unread,
Jun 20, 2012, 4:33:00 AM6/20/12
to adwor...@googlegroups.com, mind...@lits.lt
Hello Minius,


By default the AdHoc reports exclude inactive objects and those options could have impressions and clicks data on them.

To retrieve all objects, add a predicate for status and operator 'IN' and specify all possible states.


-Danial, AdWords API Team.

Minius

unread,
Jun 28, 2012, 10:10:42 AM6/28/12
to adwor...@googlegroups.com, mind...@lits.lt
Thanks for your attention,

but i try add:

<predicates>
   
<field>Status</field>
   
<operator>IN</operator>
   
<values>ENABLED</values>
   
<values>PAUSED</values>
</predicates>

I get fallowing error:
!!!2|||-1|||[SelectorError.INVALID_PREDICATE_ENUM_VALUE @ selector; trigger:'ENABLED'; errorDetails:ENABLED]???

If i try add:
<predicates>
   
<field>Status</field>
   
<operator>IN</operator>
   
<values>ACTIVE</values>
   
<values>PAUSED</values>
</predicates>

Than i get same old resut... :(
Maybe i`m wrong somewhere ?
Can you be more specific, please

AdWordsAPIAdvisor

unread,
Jul 3, 2012, 7:21:51 PM7/3/12
to weba...@lits.lt, adwor...@googlegroups.com, mind...@lits.lt
Hello Minius,


Try the following predicate:

<predicates>
<field>Status</field>
<operator>IN</operator>
<values>DELETED</values>
<values>PAUSED</values>
<values>ACTIVE</values>
</predicates>


-Danial, AdWords API Team.


Original Message Follows:
------------------------
From: Minius <weba...@lits.lt>
Subject: Re: why keyword performance report different result by comparing
results from HTTP Request and directly from mcc
Date: Thu, 28 Jun 2012 07:10:42 -0700 (PDT)
> --
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> Also find us on our blog and discussion group:
> http://adwordsapi.blogspot.com
> http://groups.google.com/group/adwords-api
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>
> You received this message because you are subscribed to the Google
> Groups "AdWords API Forum" group.
> To post to this group, send email to adwor...@googlegroups.com
> To unsubscribe from this group, send email to
> adwords-api...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/adwords-api?hl=en

Oliver

unread,
Jul 4, 2012, 9:30:41 AM7/4/12
to adwor...@googlegroups.com, weba...@lits.lt, mind...@lits.lt
Danial,

I don't know if your suggestion will work for Minius but I tried it myself (as I was having this exact issue) and I still see no difference when I use the predicate.  My performance reports are still returning only active objects.

This is causing a tricky situation as some keywords get disabled during the day and hence, even though they are currently inactive, they still have performance data that we need to get.

Is there any other way we can reliably get the performance data (impressions, etc.) for inactive objects?

Oliver
> adwords-api+unsubscribe@googlegroups.com

AdWordsAPIAdvisor

unread,
Jul 4, 2012, 5:57:44 PM7/4/12
to oliver....@gmail.com, adwor...@googlegroups.com, weba...@lits.lt, mind...@lits.lt
Hello Oliver, Minius,


If you still get discrepancy, please send both reports with corresponding report definition to me via private message. I'll check why this happens for a particular account.


-Danial, AdWords API Team.



Original Message Follows:
------------------------
From: Oliver <oliver....@gmail.com>
Subject: Re: why keyword performance report different result by comparing
results from HTTP Request and directly from mcc
Date: Wed, 4 Jul 2012 06:30:41 -0700 (PDT)
> > > adwords-api...@googlegroups.com
> > > For more options, visit this group at
> > > http://groups.google.com/group/adwords-api?hl=en
> >
> >
>
> --
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> Also find us on our blog and discussion group:
> http://adwordsapi.blogspot.com
> http://groups.google.com/group/adwords-api
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>
> You received this message because you are subscribed to the Google
> Groups "AdWords API Forum" group.
> To post to this group, send email to adwor...@googlegroups.com
> To unsubscribe from this group, send email to
> adwords-api...@googlegroups.com

Minius

unread,
Jul 5, 2012, 2:05:54 AM7/5/12
to adwor...@googlegroups.com, oliver....@gmail.com, weba...@lits.lt, mind...@lits.lt

Hello,

I try that suggestion, but without no success. I get the same old result.

> > > adwords-api+unsubscribe@googlegroups.com
> > > For more options, visit this group at
> > > http://groups.google.com/group/adwords-api?hl=en
> >
> >
>
> --
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> Also find us on our blog and discussion group:
> http://adwordsapi.blogspot.com
> http://groups.google.com/group/adwords-api
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>
> You received this message because you are subscribed to the Google
> Groups "AdWords API Forum" group.
> To post to this group, send email to adwor...@googlegroups.com
> To unsubscribe from this group, send email to
> adwords-api+unsubscribe@googlegroups.com
Reply all
Reply to author
Forward
0 new messages