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
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/b5abec34-c78d-4222-b65a-42876583f518n%40googlegroups.com.