Problems Filtering Product Partitions On Query

136 views
Skip to first unread message

Gustavo Schlaien

unread,
Nov 5, 2014, 12:25:31 PM11/5/14
to adwor...@googlegroups.com
Hi,
I'm having many problems updating via Adwords API bids for Products elements related on Google Merchant.
What happens is the following:
I can make the UPDATE of bids by using AdGroupCriterionService, in which case the Criterion  element is a Product Partition.
Problem is I do not know the ID of the Product Partition so I need to search it by ID.
A Product Partition contains a member CaseValue  (which defines the partition), and I can identify the partition by those of type ProductOfferId and thus obtain the Criterion ID from a certain product.
But to get a specific Product Partition entity I have to make a query using (AdGroupCriterionService) and in that query i do not see how to specify in PREDICATE to filter by caseValue.
So i have to retrieve all the entities Product Partition and do a lop to find the Product Offer Id i want to update the bid to.

QUESTION: is there a way to filter the Product Partition by caseValue or similar to obtain only the one with a certain value there (filter by Product Offer Id ).


Many thanks!

Best Regards,
Gustavo Schlaien

Josh Radcliff (AdWords API Team)

unread,
Nov 5, 2014, 5:36:55 PM11/5/14
to adwor...@googlegroups.com
Hi Gustavo,

AdGroupCriterionService does not support filtering by caseValue, so at this time your only option is to issue a get request for all product partitions for the AdGroup and then iterate through the results to find the matching partition.

When issuing the get, I recommend using a Selector with the following attributes:
  1. fields: "AdGroupId", "Id", "ParentCriterionId", "PartitionType", "CriteriaType", "CaseValue", "CpcBid", "CpcBidSource", "Status
  2. predicates:
    1. AdGroupId EQUALS your_ad_group_id
    2. CriteriaType EQUALS "PRODUCT_PARTITION"
    3. Status IN [ "ENABLED", "PAUSED"]
This will ensure you only get ProductPartition criteria back and since the "CaseValue" field was requested, you should see all the fields populated on the underlying ProductDimension of each partition. Given the full collection of criteria, you can iterate through them, find the partition where caseValue is a ProductOfferId with the value you want, and then use that partition's ID in your bid update.

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages