Kevin,

Thanks.

- Moved the adWordsUser instantiation out of the loop.

- This is already done that way:

        while ( $row06 = $result06->fetch_object() ) {
                $distinctAdGroupId[] = (float) $row06-
>adGroupId;    }

Notice that all the adgroupsId's are put into an array and then:

$adGroupIdPredicate = new Predicate('AdGroupId', 'IN',
$distinctAdGroupId);


Thank you so much for reviewing the code.  All the developers working
with your code really appreciate your help and the extent of your
documentation/examples.


On Nov 4, 8:49 am, Kevin Winter <kevin.win...@google.com> wrote:
> Hi,
>   The PHP example as posted will get the job done, but there are a few
> improvements that could be made to make it more efficient.
>
> - Since all these keywords appear to be in the same account, you can move
> the instantiation of the AdWordsUser outside the while loop.  This is
> especially important if you will be requesting a large number of keywords,
> because with the current code it will request an AuthToken (valid for two
> weeks) for each keyword, which could easily trigger a CAPTCHA challenge.
> - Likewise, you could change the predicate to include ALL AdGroupIds
> instead of one per request.
>
> I'd also like to mention that you can use Predicates when defining reports,
> which may help them return more quickly (especially for a large number of
> Keywords).
>
> - Kevin Winter
> AdWords API Team

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to