Update bid on Hotel Group

50 views
Skip to first unread message

Mattia Gervasoni

unread,
Aug 14, 2019, 8:54:20 AM8/14/19
to AdWords API and Google Ads API Forum

Hello,

I am working on Hotel campaign on Google Ads. 

Below is the account hierarchy:

MCC XXXXXXX
     Customer Id XXXXXXXX
          Campaign Id XXXXXXX
             AdGroup Id XXXXXXX
                 Under the same AdGroup we have several Hotel Group as per image attached 


I am trying to update the bid value (field cpc_bid_micros) for one hotel. 

I built an AdGroupCriterion object and I have set a ListingGroupInfo object using HotelIdInfo as ListingDimensionInfo.

$listingGroupInfo = new Google\Ads\GoogleAds\V2\Common\ListingGroupInfo();

$listingGroupInfo->setType(Google\Ads\GoogleAds\V2\Enums\ListingGroupTypeEnum\ListingGroupType::UNIT);

//set HotelInfoID
$listingDimensionInfo = new Google\Ads\GoogleAds\V2\Common\ListingDimensionInfo();

$hotelIdInfo = new Google\Ads\GoogleAds\V2\Common\HotelIdInfo();

$hotelIdInfo->setValue(new Google\Protobuf\StringValue(['value' => $hotel_id]));

Then I call the update operation on the cpc_bid_micros field as per below code, using FieldMask: 

$adGroupCriterion->setCpcBidMicros(new Google\Protobuf\Int64Value(['value' => $bid_value_micros]));

$adGroupCriterionOperation = new \Google\Ads\GoogleAds\V2\Services\AdGroupCriterionOperation();
$adGroupCriterionOperation->setUpdate($adGroupCriterion);
$fieldMask = new Google\Protobuf\FieldMask();
$fieldMask->setPaths(array("cpc_bid_micros"));
$adGroupCriterionOperation->setUpdateMask($fieldMask);
     
I am getting the following error:

"errorCode": {

"fieldError": "FIELD_CANNOT_BE_CLEARED"

},

"message": "The field cannot be cleared.", 


Any suggests?
Reply all
Reply to author
Forward
0 new messages