Attach user-list of custom users to App Campaign

172 views
Skip to first unread message

Shivam Kumar

unread,
Mar 13, 2024, 5:26:35 AM3/13/24
to Google Ads API and AdWords API Forum
Hi there,
I am creating app campaign (UAC) using Python code (https://github.com/googleads/google-ads-python/blob/bcee4d08df0ea037d695d1bbcb595d7ee8adf9cd/examples/advanced_operations/add_app_campaign.py). I am successfully able to create it, but I want to target custom audience based upon user list, which I already have created using  https://github.com/googleads/google-ads-python/blob/bcee4d08df0ea037d695d1bbcb595d7ee8adf9cd/examples/remarketing/set_up_remarketing.py#L78

then I changed campaign_criterion to user_list https://github.com/googleads/google-ads-python/blob/bcee4d08df0ea037d695d1bbcb595d7ee8adf9cd/examples/advanced_operations/add_app_campaign.py#L186

and I am getting following error:
```
Request made: ClientCustomerId: XXXXXXX, Host: googleads.googleapis.com, Method: /google.ads.googleads.v15.services.CampaignCriterionService/MutateCampaignCriteria, RequestId: TaaDFfP__RdmrcF7uunI5w, IsFault: True, FaultMessage: This operation is not permitted on this campaign type      
Request with ID "TaaDFfP__RdmrcF7uunI5w" failed with status "INVALID_ARGUMENT" and includes the following errors:
        Error with message "This operation is not permitted on this campaign type".
                On field: operations
                On field: create
                On field: user_list
                On field: user_list
```

I created ad_group_criterian also to target user_list and kept campaign_criterian to target only location and language but I am getting following error:
``
Request made: ClientCustomerId: XXXXXXX, Host: googleads.googleapis.com, Method: /google.ads.googleads.v15.services.AdGroupCriterionService/MutateAdGroupCriteria, RequestId: 76BzHjswXVxpQb6ccgoI9g, IsFault: True, FaultMessage: The operation is not allowed for the given context.
Request with ID "76BzHjswXVxpQb6ccgoI9g" failed with status "INVALID_ARGUMENT" and includes the following errors:
        Error with message "The operation is not allowed for the given context.".
                On field: operations
                On field: create
                On field: user_list
``

Attached file are the code I have tried.


app_campaign.py
user_list.py

Google Ads API Forum Advisor

unread,
Mar 13, 2024, 6:59:51 AM3/13/24
to shiv...@vaticai.com, adwor...@googlegroups.com

Hi,

Thank you for contacting the Google Ads API support team.

After reviewing your concern, I understand that you are getting an “INVALID_ARGUMENT” error when changing the campaign criterion to the user_list. Kindly note that, as per the steps mentioned in the Create App Campaign documentation, the app campaign supports campaign-level targeting by language and location only. This might be the reason you are getting “The operation is not allowed for the given context.”

To assist you more accurately, please provide us complete API logs (request and response with request-id and request header) generated at your end.

Kindly note that you have to enable logging if you are using a client library. You can refer to the Python guides to enable logging on your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via the Reply privately to the author option or a direct private reply to this email. 

This message is in relation to case "ref:!00D1U01174p.!5004Q02rzuHk:ref" (ADR-00227076)

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages