I'm using the v2009 Perl libraries.

I've got this code to get an ad group, where I then update the bid
amount, and pass it back into mutate.

my $new_bid = 0.14;
my $response = $client->AdGroupService()->get({selector => {adGroupIds
=> [1234567890]}});
my $ad_group = $response->result()->{'entries'};
$ad_group->{'bids'}->{'keywordMaxCpc'}->{'amount'}->{'microAmount'} =
$new_bid*1000000;
my $operations = {operations => [{operator => 'SET',
                                                  operand =>
$ad_group}]
                          };
$response = $client->AdGroupService->mutate($operations);

However, that generates this error:
cannot use ManualCPCAdGroupBids reference as value for bids -
Google::AdWords::v200909::Types::AdGroupBids required at /usr/lib/
perl5/site_perl/5.8.8/SOAP/WSDL/Client/Base.pm line 26

An ad group object is supposed to be the argument to the operand
according to the documentation here:
http://code.google.com/apis/adwords/v2009/docs/reference/AdGroupService.AdGroupOperation.html
So I'm not sure why my code is incorrect.

As an alternative, I've tried using this hash as the operand:
operand => {id => 1234567890,
                  bids => {AdGroupBids__Type =>
'ManualCPCAdGroupBids',
                               keywordMaxCpc => {
                                                             amount =>
{
 
microAmount => ($new_bid*1000000)
                                                                              }
                                                             }
                              }
                 }
This, however, errors because I'm including keywordMaxCpc. I seem to
only be able to specify the type, but not the actual new bid amount I
want to set.

How should I actually go about updating the default ad group bid?

Thanks for any help on this.

-- 
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.

Reply via email to