How to partiotion google shopping adgroups (Python)

132 views
Skip to first unread message

Ben

unread,
Apr 5, 2019, 6:53:14 AM4/5/19
to AdWords API and Google Ads API Forum

Hey,

 

I created shopping campaigns and adgroups using the provided code examples: (https://github.com/googleads/googleads-python-lib/tree/master/examples/adwords/v201809/shopping).


However, currently all adgroups have all prodcuts. I would like to partion the adgroups via custom labels, which are already imported and linked via the merchant account.

 

Unfortunately, I didn't mange to get add_product_partition_tree.py running. I recevie the following error:


AdGroupCriterionError.PRODUCT_PARTITION_ALREADY_EXISTS @ operations[0].operand.criterion, AdGroupCriterionError.PRODUCT_PARTITION_DOES_NOT_EXIST.


I can also add the detailed soap request/logging. 

 

My questions are:


Is it possible to partion using existing custom labels? 

From other quesitions (https://groups.google.com/forum/#!topic/adwords-api/32tiC3ncAms) it seems like it's not possible to update existing partions. However, that would be our preferred method. 

What does the xsi_type stand for?

Do I have to set a bidding category (luggage in the example code)


Thanks! 

Ben

unread,
Apr 5, 2019, 6:53:16 AM4/5/19
to AdWords API and Google Ads API Forum
Hey, 

I managed to create shopping campaigns and adgroups using the examples (https://github.com/googleads/googleads-python-lib/tree/master/examples/adwords/v201809/shopping).

However, currently each adgroup has all products. Using add_product_partition_tree.py I wasn't able to create partions within the adgroup - error was:

AdGroupCriterionError.PRODUCT_PARTITION_ALREADY_EXISTS @ operations[0].operand.criterion, AdGroupCriterionError.PRODUCT_PARTITION_DOES_NOT_EXIST. 


Preferably, I would like to use custom labels from the merchant account for partioning. 

Further questions are:

what does xsi_type stand for?
do I have to use the bidding category (in the example it was luggage_category)
How can I update existing partions without deleting the current one ((https://groups.google.com/forum/#!topic/adwords-api/32tiC3ncAms).

googleadsapi...@google.com

unread,
Apr 5, 2019, 3:48:59 PM4/5/19
to AdWords API and Google Ads API Forum
Hello Ben, 

From the error, it looks like the subdivision creation is failing as there is already a product partition. The subsequent nodes seems to fail as the subdivision creation failed. Could you please confirm if you were creating the ad group via Google Ads UI? If so, you will need to first remove the default product partition and then retry to create your new product partition. If you want to do this in a new ad group, you could create one via the API and then use the code sample that you shared to create the product partition. Please give this a try and let me know if you face any issues.

If you're using the custom labels you will need to specify the xsi_type as ProductCustomAttribute. Please refer to this sample as a reference. You may refer to this guide on how to update existing partitions. 

Let me know if you have any other questions.

Regards,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Ben

unread,
Apr 8, 2019, 3:53:01 AM4/8/19
to AdWords API and Google Ads API Forum
Hey Bharani, 

thanks for the answer. I am creating everything via Python Scripts. I defined a product scope for one campaign and now the products are no longer automatically attached to the adgroups. Could you give some explanation on how product scope and product partioning relate to one another?

I tried to create two subdivisions - first on ProductCustomAttribute (CUSTOM_ATTRIBUTE_1) and thereafter on ProductBrand. I attached the soap log. 

googleadsapi...@google.com

unread,
Apr 8, 2019, 3:38:46 PM4/8/19
to bi-...@flaconi.de, AdWords API and Google Ads API Forum
Hello Ben, 

A ProductPartition can be any of several subclasses of the ProductDimension type. You can add a ProductScope criterion to filter the products at the campaign levelThis could greatly reduce the number of ad groups per campaign and may make your campaigns more manageable. You can create at most one ProductScopeper campaign. A ProductScope is a container for one or more ProductDimensions that represent a simple filter on one aspect of a product. You can have up to seven different ProductDimension objects to a ProductScope to limit the number of products. You may also refer to this forum post which might be helpful.

You missed the attachment in your response. You can reply back via Reply privately to author option to share the logs if you're having an issue.

Thanks,
Bharani, Google Ads API Team

googleadsapi...@google.com

unread,
Apr 10, 2019, 3:16:08 PM4/10/19
to AdWords API and Google Ads API Forum
Hello Ben,

Thank you for sharing the logs. The error indicates that you're missing the CaseValue. Each immediate child of a subdivision must have a caseValue of the same ProductDimension subtype. Only the root node doesn't have a caseValue. Please check this guide for more information.

Regards,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.


If not -- reply to this email and tell us what else we can do to help.

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Message has been deleted

Ben

unread,
Apr 12, 2019, 3:19:32 AM4/12/19
to AdWords API and Google Ads API Forum
Attached my python file and the soap log file.
add_product_partition_tree_mod.py
log.txt

googleadsapi...@google.com

unread,
Apr 12, 2019, 11:30:38 AM4/12/19
to bi-...@flaconi.de, AdWords API and Google Ads API Forum
Hello Ben, 

I think you missed my private response. Please find my response below:

Ben

unread,
Apr 13, 2019, 4:46:44 AM4/13/19
to AdWords API and Google Ads API Forum

Hey Bharani,

 

thx for the answer, but how and where exactly can I define the CaseValue? I understand the general concept, but not sure where to set it - I thought I defined it via e.g. other_product_canonical_condition – or which function is used?

 

Best

 

Ben

googleadsapi...@google.com

unread,
Apr 15, 2019, 12:22:13 PM4/15/19
to bi-...@flaconi.de, AdWords API and Google Ads API Forum
Hi Ben, 

You may refer to this code sample where the caseValue is set to None. Can you make changes in your code snippet to set the value as None?

Thanks,
Reply all
Reply to author
Forward
0 new messages