UserList, Removing all UserData from a UserList

445 views
Skip to first unread message

Matan Shavit

unread,
Jan 12, 2022, 10:31:19 AM1/12/22
to Google Ads API and AdWords API Forum
Hello, Im using the UserData .setCreate and .setRemove to create add/remove operations to my UserList, I want to be able to delete all UserData from the UserList.
Using Adwords API I used MutateMembersOperand, operand .setRemoveAll (true). 
What is the correct way to do it in GoogleAds API?
Im using the UserDataService to add/remove UserData.

Google Ads API Forum Advisor

unread,
Jan 12, 2022, 10:57:52 PM1/12/22
to adwor...@googlegroups.com
Hi Matan,

Thank you for posting your concern.

Please note that there are 2 services in the Google Ads API that you can use for managing a user list as mentioned on this document, one is the UserDataService and the other one is the OfflineUserDataJobService. You may refer to this document to know more information about OfflineUserDataJobService for managing customer match or user list.

However, it is depend on your end what is feasible to implement based on the capabilities of each service specified in the documents that I provided.

Let me know if you have further questions.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2UjHZN:ref

Matan Shavit

unread,
Jan 13, 2022, 9:06:44 AM1/13/22
to Google Ads API and AdWords API Forum

Thanks for the reply,
I want to upload by diff, meaning adding to the segment more relevant devices and removing devices that are no longer relevant, using the setCreate and setRemove operations.
I read that I shouldn't  mix both create and remove in the same OfflineUserDataJob, and that I cant run more than one job per UserList. Taking into consideration that a OfflineUserDataJob can take up to 24h.
What are my alternatives?
is uploading by diff as mentioned above supported?
Can you please explain the difference in use for the UserDataService compared to the OfflineUserDataJobService.

Google Ads API Forum Advisor

unread,
Jan 14, 2022, 12:26:19 AM1/14/22
to adwor...@googlegroups.com

Hi Matan,

Thanks for getting back to us.

Kindly see below responses to your queries:



I read that I shouldn't  mix both create and remove in the same OfflineUserDataJob, and that I cant run more than one job per UserList. Taking into consideration that a OfflineUserDataJob can take up to 24h.
What are my alternatives?


>> Yes, you don’t have to mix create and remove operations within the same OfflineUserDataJob. Doing so can result in a CONFLICTING_OPERATION error. Note that this does not apply to adding operations to an existing job, which can be done at any time before the job is started. We ask to avoid simultaneously running multiple OfflineUserDataJob processes that modify the same user list (that is, multiple jobs whose CustomerMatchUserListMetadata.user_list point to the same resource name). Doing so can result in a CONCURRENT_MODIFICATION error since multiple jobs are not permitted to operate on the same list at the same time. 



Can you please explain the difference in use for the UserDataService compared to the OfflineUserDataJobService.

>> Kindly note that the OfflineUserDataJobService service behaves similarly to UserDataService; both can upload data for user lists, but OfflineUserDataJobs are processed asynchronously. 

Let us know if you have any further questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2UjHZN:ref

Matan Shavit

unread,
Jan 20, 2022, 6:16:11 AM1/20/22
to Google Ads API and AdWords API Forum
Hey Im getting CONCURRENT_MODIFICATION when uploading operations to offline user data job.
When reading the doc I came to the assumption that I can only get this error by running multiple jobs not by uploading the operations.
can you please clarify? 

Matan Shavit

unread,
Jan 20, 2022, 8:06:06 AM1/20/22
to Google Ads API and AdWords API Forum

  • Avoid simultaneously running multiple OfflineUserDataJob processes that modify the same user list (that is, multiple jobs whose CustomerMatchUserListMetadata.user_list point to the same resource name). Doing so can result in a CONCURRENT_MODIFICATION error since multiple jobs are not permitted to operate on the same list at the same time. This error can also occur if attempting to simultaneously modify a list through the Google Ads UI and the Google Ads API. Note that this does not apply to adding operations to an existing job, which can be done at any time before the job is started.

    Im uploading the data in concurrent batches to a single  OfflineUserDataJob  but i get the CONCURRENT_MODIFICATION error.

Matan Shavit

unread,
Jan 20, 2022, 8:07:30 AM1/20/22
to Google Ads API and AdWords API Forum

using the .addOfflineUserDataJobOperations
.addAllOperations to my current batch.

Google Ads API Forum Advisor

unread,
Jan 20, 2022, 10:19:56 PM1/20/22
to adwor...@googlegroups.com

Hi Matan,

Could you provide us with the complete request and response logs with the request-id generated when the error CONCURRENT_MODIFICATION encountered while uploading operations to offline user data job, so our team can better check?

If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link. You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,

Matan Shavit

unread,
Jan 21, 2022, 6:28:05 AM1/21/22
to Google Ads API and AdWords API Forum
Hey, Adding the error details, I masked the modile_ids and the customer id. let me know if you need it.
The request Id = dB-PDXXubID9y9naxBm4Tg

"message":"FAILURE REQUEST DETAIL.\nRequest\n-------\nMethodName: google.ads.googleads.v9.services.OfflineUserDataJobService/AddOfflineUserDataJobOperations\nEndpoint: googleads.googleapis.com:443\nHeaders: {developer-token=REDACTED, login-customer-id=XXXX, x-goog-api-client=gl-java/1.8.0_211 gccl/16.0.3 gapic/16.0.3 gax/2.6.1 grpc/1.27.2}\nBody: resource_name: \"customers/XXXXX/offlineUserDataJobs/16698510633\"\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\noperations {\n  create {\n    user_identifiers {\n      mobile_id: \"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\"\n    }\n  }\n}\nenable_partial_failure: true\n\n\nResponse\n--------\nHeaders: Metadata(content-type=application/grpc,request-id=dB-PDXXubID9y9naxBm4Tg,date=Fri, 21 Jan 2022 11:19:50 GMT,alt-svc=h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\")\nBody: null\nFailure message: errors {\n  error_code {\n    database_error: CONCURRENT_MODIFICATION\n  }\n  message: \"Multiple requests were attempting to modify the same resource at once. Please retry the request.\"\n}\nrequest_id: \"dB-PDXXubID9y9naxBm4Tg\"\n\nStatus: Status{code=INVALID_ARGUMENT, description=Request contains an invalid argument., cause=null}.","logger_name":"com.google.ads.googleads.lib.request.detail"


I also noticed this at the end status: INVALID_ARGUMENT, description=Request contains an invalid argument., cause=null. but I see no problem in the request. 
Please let me know how can it be solved.
Thanks.

Google Ads API Forum Advisor

unread,
Jan 24, 2022, 12:54:08 AM1/24/22
to adwor...@googlegroups.com
Hi Matan,

Thank you for providing these additional details.

However, could you confirm if in your system you are also performing other OfflineUserDataJobService requests that are also making changes to the same userlist resource? I asked because this type of simultaneous requests are the common cause of the CONCURRENT_MODIFICATION error that you are encountering.

Since you have logging enabled, could you collect all the logs generated during the same time these set of logs were generated so we can check whether there are other instances that are making changes to the same resource?

You may send over the complete logs without the masked details using the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


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