Hi Marc,
Further to Dorian's comment here is some sample code:
while($rec=mysql_fetch_assoc($sqlResult))
{
$dbKeys[]=$rec['KWP_id'];
// Create keywordParam.
$adParam = new AdParam($rec['AdGroupID'], $rec['criterion_id'],
cleanCurrency($rec['KWP_text']), $rec['KWP_index']);
$operation = new AdParamOperation($adParam, 'SET');
$operations[] = $operation;
}
$adParams = $adParamService->mutate($operations);
I have a 'LIMIT 400' in my SQL
On Monday, 30 July 2012 17:52:39 UTC+1, marc wrote:
>
> AdParam Get/Set best practices
> I am running a script that updates the AdParams for a campaign once a day.
> There are potentially 90,000 adgroups that could be updated daily.
>
> This takes forever, when it works without some sort of error occurring.
>
> I was wondering if anyone had some tips on best practices to use when
> running adparam updates.
>
> Here's how I perform the updates.
>
>
> $adGroupId = <an adGroup id>;
> $keywordIds = <array of keyword ids associated with $adGroupId>;
> $param1 = <numeric value>;
>
> try {
> $operations = array();
> foreach($keywordIds as $keywordId) {
> $adParam1 = new AdParam($adGroupId, $keywordId, $param1, 1);
>
> // Create operations for the first adparam
> $adParamOperation = new AdParamOperation();
> $adParamOperation->operand = $param1;
> $adParamOperation->operator = 'SET';
> $operations[] = $adParamOperation;
> }
>
> if(!empty($operations)) {
> $adParams = $this->adParamService->mutate($operations);
> }
> }
> catch (Exception $e) {
> .
> .
> .
> }
>
>
> Thanks
>
>
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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