Hi Gustav,
I'd strongly recommend using reports for this purpose
<https://developers.google.com/adwords/api/docs/guides/reporting>. This
will allow you to specify the filter you require, incurs no API unit cost
and you don't have to build a SOAP request yourselves.
Cheers,
Dorian
On Wednesday, December 26, 2012 7:31:43 PM UTC+1, Gustav Gennrich wrote:
>
> Hi,
>
> I am trying to retrieve stats through the AdGroupService for all enabled
> adgroups for a specified date range. I am able to retrieve the Clicks,
> Cost, AveragePosition, Ctr, and Status. However, I want to be able to
> filter by the network type. Currently, all the results coming back have the
> network set as "ALL". Please bare in mind I am NOT using the google adwords
> gem in my rails project so please do not reference that (we are using rails
> 2.3.11 and the new gem doesn't work with it). I am using Savon to generate
> the SOAP requests. Below is my Savon code for the selector and the
> generated SOAP request:
>
> selector = {
> :fields => ["KeywordText", "Clicks", "Cost", "AveragePosition",
> "Ctr", "Status"],
> :predicates => [
> {:field => "Status", :operator => "IN", :values => ["ACTIVE"]}
> ],
> :date_range => {:min => options[:start_date], :max =>
> options[:end_date]},
> :paging => {
> :start_index => 0,
> :number_results => options[:max_results]
> }
> }
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns:tns="https://adwords.google.com/api/adwords/cm/v201209"
>
> xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
>
> xmlns:ins0="https://adwords.google.com/api/adwords/cm/v201209">
>
> <env:Header>
>
> <ins0:RequestHeader xmlns="
> https://adwords.google.com/api/adwords/cm/v201209">
>
> <clientCustomerId>***-***-***</clientCustomerId>
>
> <userAgent>rails_app</userAgent>
>
> <developerToken>***</developerToken>
>
> <authToken>***</authToken>
>
> </ins0:RequestHeader>
>
> </env:Header>
>
> <env:Body>
>
> <ins0:get xmlns="https://adwords.google.com/api/adwords/cm/v201209">
>
> <serviceSelector>
>
> <fields>Id</fields>
>
> <fields>Name</fields>
>
> <fields>Clicks</fields>
>
> <fields>Cost</fields>
>
> <fields>AveragePosition</fields>
>
> <fields>Ctr</fields>
>
> <fields>Status</fields>
>
> <predicates>
>
> <field>Status</field>
>
> <operator>IN</operator>
>
> <values>ENABLED</values>
>
> </predicates>
>
> <dateRange>
>
> <min>20121126</min>
>
> <max>20121225</max>
>
> </dateRange>
>
> <paging>
>
> <startIndex>0</startIndex>
>
> <numberResults>10000</numberResults>
>
> </paging>
>
> </serviceSelector>
>
> </ins0:get>
>
> </env:Body>
>
> </env:Envelope>
>
> The predicate field doesn't appear to have a filter on the network field,
> however, I notice that this link
> https://developers.google.com/adwords/api/docs/reference/latest/AdGroupService.Statshas
> a network setting which I am not able to figure out how to set. Any
> help would be greatly appreciated!
>
> Thanks,
>
> Gustav
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en