API Hangs on MutateuserList command

177 views
Skip to first unread message

Dataseek Business Solutions

unread,
Mar 9, 2023, 2:48:01 PM3/9/23
to Google Ads API and AdWords API Forum
My app hang while processing, so response takes long and hangs forever.

UserListServiceClient service = client.GetService(Services.V12.UserListService);

            // Creates the user list.
            UserList userList = new UserList()
            {
                Name = "projeto",
                Description = "Database users",
                // Customer Match user lists can use a membership life span of 10000 to
                // indicate unlimited; otherwise normal values apply.
                // Sets the membership life span to 30 days.
                MembershipLifeSpan = 90,
                CrmBasedUserList = new CrmBasedUserListInfo()
                {
                    UploadKeyType = CustomerMatchUploadKeyType.ContactInfo
                }
            };
            // Creates the user list operation.
            UserListOperation operation = new UserListOperation()
            {
                Create = userList
            };


            string userListResourceName = "ND";
            // Issues a mutate request to add the user list and prints some information.
            try
            {
             

                MutateUserListsResponse response = service.MutateUserLists(customerId.ToString(), new[] { operation });
                userListResourceName = response.Results[0].ResourceName;

Google Ads API Forum Advisor

unread,
Mar 10, 2023, 1:57:49 AM3/10/23
to rifd...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out to us.

Could you kindly elaborate and provide more details on your concern, so that we could provide precise guidance accordingly? We would also need your help in providing us with the complete API logs (request and response with request-id) generated on your end so that we can further check if you encountered any API errors and if the request was done correctly.

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.

Best regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2jXtVV:ref

Dataseek Business Solutions

unread,
Mar 10, 2023, 10:23:24 AM3/10/23
to Google Ads API and AdWords API Forum
Hello there,

 
If the request hangs , I dont get any responses.

  Its just a NO RESPONSE problem, so no log here.



 I GOT CONNECTED AND CAN RETRIEVE MY CUSTOMERS HERE:

     var customerResourceNames = customerService.ListAccessibleCustomers();


My code wasnt very clear? Here goes again, DONT GET RESPONSE FROM 

UserListServiceClient service = client.GetService(Services.V12.UserListService);

            // Creates the user list.
            UserList userList = new UserList()
            {
                Name = "PROJECT NAME",

                Description = "Database users",
                // Customer Match user lists can use a membership life span of 10000 to
                // indicate unlimited; otherwise normal values apply.
                // Sets the membership life span to 30 days.
                MembershipLifeSpan = 90,
                CrmBasedUserList = new CrmBasedUserListInfo()
                {
                    UploadKeyType = CustomerMatchUploadKeyType.ContactInfo
                }
            };
            // Creates the user list operation.
            UserListOperation operation = new UserListOperation()
            {
                Create = userList
            };


            string userListResourceName = "ND";
            // Issues a mutate request to add the user list and prints some information.
     
             

                MutateUserListsResponse response = service.MutateUserLists(customerId.ToString(), new[] { operation });

 HANGS HERE. OK?

Google Ads API Forum Advisor

unread,
Mar 10, 2023, 5:10:54 PM3/10/23
to rifd...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for getting back to us.

Unfortunately, provided code snippet is not enough for us to see the issue. However, can you confirm if you are using the .Net client library to send Google Ads API requests? If yes, can you confirm if you already followed this guide for the installation and configuration

You may double check again if you installed it correctly, and enable logging on your end to see the error. If possible, you may make fresh new environment of .NET client library with new Google Ads API v13, and see if it works on your end.

Regards,

Zweitze

unread,
Mar 13, 2023, 11:42:35 AM3/13/23
to Google Ads API and AdWords API Forum
Is the target .NET Framework? I mean: not .NET Core, .NET standard.
Then it could be a problem of the library.

Check if any call to the API hangs. If so, check out:

Extra proof could be obtained to downgrade the library to a version before 14.0.0.
That would also mean you have to go back to V11. But, for a quick test, it's really worth it.

The solution is to use async methods, and that is a very painfull process. If you're upgrading to V12, which sunsets in two weeks or so, you could be looking at weeks of development - depending on your capabilities with C# (esp. your proficiency with async coding) and the amount of your code.

Google Ads API Forum Advisor

unread,
Mar 13, 2023, 5:38:27 PM3/13/23
to zwe...@gmail.com, adwor...@googlegroups.com

Hi, 

Thanks for reaching out to the Google Ads API Forum. I hope you are doing well today.

@Zweitze
Thank you for sharing your insights and providing a solution on this matter. We highly appreciate it.

@Dataseek Business Solutions
Could you please see the post by Zweitze on this thread, check the provided information and try this on your end.

Have a great day.

Regards,

Dataseek Business Solutions

unread,
Mar 14, 2023, 9:36:08 AM3/14/23
to Google Ads API and AdWords API Forum
Thanks for your answer. I will try some changes here.

Dataseek Business Solutions

unread,
Mar 16, 2023, 9:03:14 AM3/16/23
to Google Ads API and AdWords API Forum
Hello everyone. Here are an example that worked for us after upgrading Google API packages.

Create method as ASYNC TASK<>, call MutateUserListsAsync  instead of MutateUserListsA  including await.

   private async Task<MutateUserListsResponse> (before: string) CreateCustomerMatchUserList(long customerId, string projeto)
        {
            // Get the UserListService.
            UserListServiceClient service = client.GetService(Services.V13.UserListService);


            // Creates the user list.
            UserList userList = new UserList()
            {
                Name = projeto,
                Description = "Dataseek - DataMidias",

                // Customer Match user lists can use a membership life span of 10000 to
                // indicate unlimited; otherwise normal values apply.
                // Sets the membership life span to 30 days.
                MembershipLifeSpan = 120,

                CrmBasedUserList = new CrmBasedUserListInfo()
                {
                    UploadKeyType = CustomerMatchUploadKeyType.ContactInfo
                }
            };
            // Creates the user list operation.
            UserListOperation operation = new UserListOperation()
            {
                Create = userList
            };

            // Issues a mutate request to add the user list and prints some information.
            string userListResourceName ="ND";
            MutateUserListsResponse response = new MutateUserListsResponse();

            try
            {

                 response = await service.MutateUserListsAsync(
                customerId.ToString(), new[] { operation }) ;



            }
            catch (GoogleAdsException ex)
            {

                string message = ex.Message;
                string failure = ex.Failure.ToString();
                string request_id = ex.RequestId;

            }

           
            return response;
        }

Google Ads API Forum Advisor

unread,
Mar 16, 2023, 12:45:41 PM3/16/23
to rifd...@gmail.com, adwor...@googlegroups.com

Hi,

We are glad to know that after upgrading Google API packages your issue is resolved. Feel free to open new thread for additional concerns. Thank you!!

Regards,

Reply all
Reply to author
Forward
0 new messages