Product group creation(Subdivision)

95 views
Skip to first unread message

Vijay S

unread,
Oct 9, 2020, 2:08:07 PM10/9/20
to AdWords API and Google Ads API Forum
Hi Team,

I have used google ads UI  to create a shopping campaign and an ad Group then product group  called All products created by default.
What I wanted achieve through my node.js backed via ads API was , I wanted to subdivide the above mentioned group further by condition but It gave me an error - Unit node cannot have children . Then I deleted the root group(All products) and added again but this time I have set type of root as Sub division and added two unit nodes i.e condition New and Other to make the tree complete.  I have done these three things in a single request by using temporary Id's. Unfortunately I am getting an error -Subdivided listing groups must have an \"others\" case. 

Since google doesn't have ads API support for Node.js yet , I am finding difficult to make this work.

Here is my request sample and much appreciated if you can help on this. Please let me know if you need anything for this request.

let arr = [];

//Delete all products unit group
let deleteRoot = {
_resource: 'AdGroupCriterion',
_operation: 'delete',
resource_name: "customers/{custID}/adGroupCriteria/{adGroupId}~{criterian}"
}

//Add root group again
let addRoot = {
_resource: 'AdGroupCriterion',
_operation: 'create',
listing_group: {
      type: enums.ListingGroupType.SUBDIVISION,
},
ad_group: "customers/{custID}/adGroups/{adGroupId}",
status: enums.AdGroupCriterionStatus.ENABLED,
resource_name: "customers/{custID}/adGroupCriteria/{adGroupId}~-1"
}
//Add unit node under root
let addCondition = {
_resource: 'AdGroupCriterion',
_operation: 'create',
  listing_group: {
        type: enums.ListingGroupType.UNIT,
        case_value: {
              product_condition: {
              condition: enums.ProductCondition.NEW
              }
        },
    parent_ad_group_criterion: "customers/{custID}/adGroupCriteria/{adGroupId}~-1"
},
ad_group: "customers/{custID}/adGroups/{adGroupId}",
status: enums.AdGroupCriterionStatus.ENABLED,
cpc_bid_micros: toMicros(0.01),
}
// Add unit node other 
let addConditionOther = {
_resource: 'AdGroupCriterion',
_operation: 'create',
ad_group: "customers/{custID}/adGroups/{adGroupId}",
listing_group: {
     type: enums.ListingGroupType.UNIT,
     case_value: {
          product_condition: {
            }
      },
    parent_ad_group_criterion: "customers/{custID}/adGroupCriteria/{adGroupId}~-1"
},
status: enums.AdGroupCriterionStatus.ENABLED
}

//put all into an array
arr.push(deleteRoot);
arr.push(addRoot)
arr.push(addCondition);
arr.push(addConditionOther);

//execute mutate request
const response = await customer.mutateResources(arr);


Many thanks,
Vijay




Google Ads API Forum Advisor Prod

unread,
Oct 12, 2020, 3:11:10 AM10/12/20
to vijay...@gmail.com, adwor...@googlegroups.com
Hi Vijay,

Thank you for your email.

Unfortunately, the Google Ads API indeed does not support node.js and is already outside of our team's scope. If you wish to learn more about the concepts of partitioning, you can refer to this guide from the AdWords API.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2689UZ:ref
Reply all
Reply to author
Forward
0 new messages