Modifying Product Partition Bid

391 views
Skip to first unread message

jor...@jcrocker.uk

unread,
Apr 3, 2017, 2:05:46 PM4/3/17
to AdWords API Forum
Hi,

I am using the PHP API to partition products within an adgroup. Following the docs, I have successfully partitioned the products.

However, the next stage is to be able to modify bid values on the partition units.

I read in this < https://groups.google.com/d/msg/adwords-api/7_Ob030Y3vw/5Pp0-4Cu_LgJ > thread that the best way to approach this is to delete the tree and re-upload it. However, in our use case we cannot rebuild the tree and send it, we need to be able to modify the values on the partition. Given that the above thread was posted in 2014, I was hoping there would be a way to modify a partition using it's ID. Is there any way to do this?

Many thanks

Shwetha Vastrad (AdWords API Team)

unread,
Apr 3, 2017, 5:09:58 PM4/3/17
to AdWords API Forum
Hi Jordan, 

As long as you are not changing the structure of your ProductPartition tree, you can use AdGroupCriterionSerivce.mutate() to update just the bid amount of the partition unit. You can use the UpdateKeyword PHP example as a reference, which updates the final URL of a Keyword. You need to modify this example and provide the id of the product partition to update the bids as needed. Please note that if the mutate operation would make a tree invalid, you must also include the operation that fixes it again in the same request. To be valid, all child nodes of a subdivision must have a caseValue of the same type, and every subdivision must contain an "other" node.

Regards,
Shwetha, AdWords API Team.

jor...@jcrocker.uk

unread,
Apr 7, 2017, 4:10:12 AM4/7/17
to AdWords API Forum
Hi,

Thanks for the response - that example has helped bootstrap my code. However, I am now getting "Invalid Criterion ID" errors, when I attempt to mutate the Product Partitions. I know these ID's to be correct, because I store the numerical ID response in the database when the Product Partitions are created, along with the associated AdWords account and Product ID.

Example:
EntityNotFound.INVALID_ID @ operations[0].operand.criterion.id; trigger:'CriterionId{id=17106509378}'
EntityNotFound.INVALID_ID @ operations[2].operand.criterion.id; trigger:'CriterionId{id=17105799698}'
EntityNotFound.INVALID_ID @ operations[3].operand.criterion.id; trigger:'CriterionId{id=42967572895}'
EntityNotFound.INVALID_ID @ operations[4].operand.criterion.id; trigger:'CriterionId{id=17105236562}'

Can you help me solve this error?

Kind regards,
Jordan

Shwetha Vastrad (AdWords API Team)

unread,
Apr 7, 2017, 12:38:33 PM4/7/17
to AdWords API Forum
Hi Jordan, 

Could you enable logging and provide the complete SOAP request and response logs so I can take a look? Please use Reply privately to author when responding. 

Thanks,
Shwetha, AdWords API Team.

bluemar...@gmail.com

unread,
Jul 3, 2017, 5:25:21 AM7/3/17
to AdWords API Forum
Hi Shwetha,

I am trying to follow this in PHP to modify my ProductPartition, how do I get the ID of an existing ProductPartition? 

Peter Oliquino

unread,
Jul 4, 2017, 12:46:16 AM7/4/17
to AdWords API Forum
Hi,

Seeing that this is an old thread, could you create a new one along with your concern? We'll continue our discussion from there.

Best regards,
Peter
AdWords API Team

Denis B

unread,
May 16, 2020, 1:13:14 PM5/16/20
to AdWords API and Google Ads API Forum
This is the working source code. It changes bid of product partition group.    

$adWordsServices = new AdWordsServices();
    $session
= $this->getSession();
    $adGroupCriterionService
= $adWordsServices->get($session, AdGroupCriterionService::class);
    $operations
= [];
    $adGroupCriterion
= new BiddableAdGroupCriterion();
    $adGroupCriterion
->setAdGroupId(22622716325); // id of my adgroup
    $adGroupCriterion
->setCriterion(new Criterion(300519082732)); // id of partition group. you can get find this id in PRODUCT_PARTITION_REPORT in ID field (which full name is Criterion ID)
   
//
    $bid
= new CpcBid();
    $money
= new Money();
    $money
->setMicroAmount(((float)4)*1000000);
    $bid
->setBid($money);
    $biddingStrategyConfiguration
= new BiddingStrategyConfiguration();
    $biddingStrategyConfiguration
->setBids([$bid]);
    $adGroupCriterion
->setBiddingStrategyConfiguration($biddingStrategyConfiguration);
    $operation
= new AdGroupCriterionOperation();
    $operation
->setOperand($adGroupCriterion);
    $operation
->setOperator(Operator::SET);
    $operations
[] = $operation;
   
//
    $adGroupCriterionService
->mutate($operations);


вторник, 4 апреля 2017 г., 0:09:58 UTC+3 пользователь Shwetha Vastrad (AdWords API Team) написал:
Reply all
Reply to author
Forward
0 new messages