Upload hash email for CRM-UserList using google ads api

282 views
Skip to first unread message

Small Sun

unread,
Dec 16, 2022, 9:01:56 AM12/16/22
to Google Ads API and AdWords API Forum
Hi Team,

I am trying to upload 1,000,000 hash emails for a CRM userlist via Google Ads API, and a hash email represent a customer. I noticed that Doc says : 
AddOfflineUserDataJobOperationsRequest can contain at most 100,000 identifiers across all of the UserData objects in the operations. 

So if I want to upload 1,000,000 hash emails via Google Ads API, is below code right to implement this scenario? we create offlineUserDataJob once, and call AddOfflineUserDataJobOperations function 100 times to add all 1,000,000 hash emails to offlineUserDataJob, and then call RunOfflineUserDataJob function.

If I am wrong, please correct me. Thanks very much.

            // Issues a request to create the offline user data job.
            CreateOfflineUserDataJobResponse response1 = service.CreateOfflineUserDataJob(
                customerId.ToString(), offlineUserDataJob);
            string offlineUserDataJobResourceName = response1.ResourceName;


for(int i=0; i< 100; i++)
{ 
        AddOfflineUserDataJobOperationsRequest request =
                new AddOfflineUserDataJobOperationsRequest()
                {
                    ResourceName = offlineUserDataJobResourceName,
                    Operations = { BuildOfflineUserDataJobOperations() },  // BuildOfflineUserDataJobOperations function will generate 100,000 OfflineUserDataJobOperations
                    EnablePartialFailure = true,
                };
            // Issues a request to add the operations to the offline user data job.
            AddOfflineUserDataJobOperationsResponse response2 =
                service.AddOfflineUserDataJobOperations(request);
}
          Operation<Empty, OfflineUserDataJobMetadata> operationResponse =
                service.RunOfflineUserDataJob(offlineUserDataJobResourceName);

Google Ads API Forum Advisor

unread,
Dec 16, 2022, 12:27:38 PM12/16/22
to smalls...@gmail.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. Please note that our team does not provide implementation support. However, your code should send multiple requests in 100,000 identifier batches referencing the same job by resource name. The code provided seems to follow this scheme. If you need client library support, please reach out to the GitHub page associated with your client library.

Please refer to the Customer Match considerations section of the documentation for more details on Customer Match uploads.

Regards,

Google Logo
Matt
Google Ads API Team
 


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