How to use batching with UserList and UserData API for Google ads?

372 views
Skip to first unread message

Paid Media

unread,
Jan 13, 2022, 11:07:55 AM1/13/22
to Google Ads API and AdWords API Forum
Hi Team

We are trying to create the Segments and pushing customers PII to these segments. 
To create a segment we are using UserListOperation.
To create customers' data we are using UserDataOperation.
To add customers to the segment we are using UploadUserDataRequest.
All this works fine for a small number of customers, but we have to handle the large customer size greater than 30K and for that, we want to utilize the BatchJobService. 
One of its important input is MutateOperation. But we can't find any suitable mutate operation for UserData and therefore can't proceed.
Could you please help us to know how we can add a large number of customers to the Segment via BatchJobService? And also let us know if there is an alternate approach for the same requirement.

Thanks in advance.

Google Ads API Forum Advisor

unread,
Jan 13, 2022, 10:55:08 PM1/13/22
to paid.m...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for your question.

The BatchJobService currently cannot be used to upload audiences/segments. In the customer match considerations guide, you may refer to the below items for more information on uploading larger number of users :
  • The operations collection for each AddOfflineUserDataJobOperationsRequest can contain at most 100,000 elements. If you need to submit more than 100,000 operations for a job, send multiple requests with the same job resource_name.
  • 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.
Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2UjilR:ref

Paid Media

unread,
Jan 17, 2022, 6:52:02 AM1/17/22
to Google Ads API and AdWords API Forum
Hi 
I explored the suggested approach and went through the example code in the file AddCustomerMatchUserList.java. It seems that OfflineUserDataJobServiceClient has only methods (runOfflineUserDataJobAsync) for asynchronous processing. But my application has a need to upload large customers to audiences/segments synchronously. So could you please let me know if there is an API that can be utilized for uploading large customers to audiences and getting the API response synchronously?

Google Ads API Forum Advisor

unread,
Jan 18, 2022, 12:50:25 AM1/18/22
to paid.m...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for getting back to us.

Note that both UserDataService and OfflineUserDataJobService services are used in Google Ads API to upload data for user lists, but OfflineUserDataJobs are processed asynchronously. You may check this guide on how you can use UserDataService synchronously. Also, note that to upload UserData objects with additional attributes, you must use an OfflineUserDataJob where the type is set to CUSTOMER_MATCH_WITH_ATTRIBUTES.

Let us know if you have any further questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2UjilR:ref

Paid Media

unread,
Jan 18, 2022, 2:22:58 AM1/18/22
to Google Ads API and AdWords API Forum
Hi,

Thank you for the response. 

UserDataService suits our use case. But it is has a limitation of "10 operations and 100 user IDs per request" which is very low for our product. Earlier we were using AdWords API where we could pass the 20,000 Ids in one API request. But with UserDataService we need to make the 20 API calls for 20,000 Ids. That means to process the 1million customer we need to make 1000 API calls which seems too large. And larger the number of API calls more time it will take to finish and the more the overhead of getting into exceptions.

Our product is meant for processing several million customers synchronously in real time. But due to the limitation of  UserDataService, to process millions of records will have a huge impact on the overall time to upload customers to the audience.

Therefore could you please let us know if there is any better way to support this use case in Google Ads?

Google Ads API Forum Advisor

unread,
Jan 18, 2022, 11:13:04 AM1/18/22
to paid.m...@gmail.com, adwor...@googlegroups.com
Hi,

I work with Yasar and will assist you. Could you elaborate how asynchronous operations when uploading to a userlist affect you? BatchJob is asynchronous in that it provides a way to perform batches of operations on multiple services without synchronously waiting for the operations to complete. Could you elaborate on what synchronicity you need in your large userData uploads?

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2UjilR:ref

Paid Media

unread,
Jan 19, 2022, 4:53:50 AM1/19/22
to Google Ads API and AdWords API Forum

Hi,

Our product has an internal mechanism that runs in real-time and determines if the customer needs to be Added or Removed from the Audience/Segment and it maintains the state of audiences and customers. Therefore our product might decide to remove the customers from ineligible audiences and avoid unnecessary processing and API calls if there is no change.

This is the reason why we need to make synchronous calls and we cannot afford any delay in getting the response, as the above process is run frequently

Google Ads API Forum Advisor

unread,
Jan 19, 2022, 3:16:33 PM1/19/22
to paid.m...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for telling us why you need this. I raised with my team your request for synchronous adding to user lists huge amounts of userData similar to in AdWords API. This request is subject to review. You may monitor our blog for an update.

Paid Media

unread,
Jan 20, 2022, 1:13:59 AM1/20/22
to Google Ads API and AdWords API Forum
Hi

Thank you for taking this request. It would be helpful if you can provide some tracking id of it.

Google Ads API Forum Advisor

unread,
Jan 20, 2022, 11:32:16 AM1/20/22
to paid.m...@gmail.com, adwor...@googlegroups.com

Hello,

Thanks for replying back. Unfortunately, this support channel can’t provide the tracker id or any timeline information of the feature request that has been created.
Please keep an eye on our blog for further updates and announcements. 

Best regards,

Google Logo
Jakeia Sabrina
Google Ads API Team

 



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