Hi,

I managed to make it figure it out in the end. It worked by creating three 
criteria for every product: a subdivision node as the root, one unit node 
to determine the *product_item_id*, and one *other *unit node. In case 
anyone wonders, the three nodes look like this (you have to convert them to 
a 'create' operation before sending the request).

const root_node = {
    resource_name: ad_group_criterion_resource_name,
    listing_group: {
        type: enums.ListingGroupType.SUBDIVISION,
    },
    status: enums.AdGroupCriterionStatus.ENABLED,
};

const child_product_item = {
    ad_group: parent.ad_group_resource_name,
    cpc_bid_micros: cpc_bid_micros,
    listing_group: {
        parent_ad_group_criterion: ad_group_criterion_resource_name,
        case_value: {
            product_item_id: {
                value: `${parent.offerId}`,
            },
        },
        type: enums.ListingGroupType.UNIT,
    },
    status: enums.AdGroupCriterionStatus.ENABLED,
};

const child_node_other = {
    ad_group: parent.ad_group_resource_name,
    cpc_bid_micros: cpc_bid_micros,
    listing_group: {
        parent_ad_group_criterion: ad_group_criterion_resource_name,
        case_value: {
            product_item_id: {},
        },
        type: enums.ListingGroupType.UNIT,
    },
    status: enums.AdGroupCriterionStatus.ENABLED,
};

const triplet = [root_node, child_product_item, child_node_other];

Thanks for the help. Let me know please if you still see anything wrong 
with this.
On Wednesday, 2 February 2022 at 22:11:23 UTC+1 adsapi wrote:

> Hi Thomas,
>
> Could you try creating a root subdivision node and an 'other' node that is 
> a unit node to place your product Id in? I am under the impression that a 
> root node is a subdivision node.
>
> Regards,
>
> [image: Google Logo] 
> Aryeh Baker 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q2W3ZvG:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/3d2f1856-a36a-4982-ba8e-780858c25b59n%40googlegroups.com.
  • Re... Thomas D'heer
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Thomas D'heer
        • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to