User List maintenance using Google Ads API

682 views
Skip to first unread message

Abhinav Sharma

unread,
Apr 21, 2020, 4:06:59 AM4/21/20
to AdWords API and Google Ads API Forum
Hi,

I am trying to find few clarifications on below items before starting the integration with Google Ads API.

1) I wanted to use the Google Ads API over google AdWords API so that I can utilize the REST API and JSON standards, however, I read that Google Ads API is in Beta state. May I please know the timeline of when It can be available to use in Production? 
2) Creating a new user list (Audience) using Google Ads API (please note, I am not talking about Google AdWords API).
3) Populating the existing user list (Audience) using Google Ads API (not the Adwords API)
4) removing the existing user from the userlist (Audience) using Google Ads API.

Current Scenario for me:
I do have few user list (Audiences) exist in our system and we want to utilize it.


Any help would be much appreciated.

Thanks,
Abhinav Sharma

Google Ads API Forum Advisor Prod

unread,
Apr 21, 2020, 4:05:59 PM4/21/20
to adwor...@googlegroups.com
Hi Abhinav,

Thank you for reaching out. Please see my answers to your questions below:
  1. I can't speak on the timeline of Google Ads API. Please keep an eye on our Developer Blog for information on upcoming changes and future releases.
  2. You can create a UserList in Google Ads API by following one of the examples in this guide.
  3. Unfortunately, it is not currently possible to add/remove members of a UserList using Google Ads API. It is only possible in AdWords API using the mutateMembers call. Our team is aware of this feature request and its importance so please keep an eye on our blog for future information on this as well.
  4. See answer to 3
Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5001UaRix7:ref

Abhinav Sharma

unread,
Apr 22, 2020, 12:25:10 AM4/22/20
to AdWords API and Google Ads API Forum
Thanks for the clarification.

to continue on the question 3 and 4, could you please clarify my next query as mentioned below:

Lets say, on First day I create a user list with 10K members. On second day If I want to add 100 members and remove 100 members from the same user List, Can I remove few members using MutateMembers() from the existing userlist and add some new members back to the same userlist?

It does not seem like I can do the above functionality as I am referring the post https://groups.google.com/forum/#!topic/adwords-api/mnPb2kCI2zo    and it clearly mentions that we need to remove all members from the user list and add the members back to the same user list If I need to use the same userlistId. please clarify this as it is very important for me to get the better understanding on this.

Thanks,
Abhinav

cv

unread,
Apr 22, 2020, 9:10:58 AM4/22/20
to AdWords API and Google Ads API Forum
Hello Abhinav,

Lets say, on First day I create a user list with 10K members. On second day If I want to add 100 members and remove 100 members from the same user List, Can I remove few members using MutateMembers() from the existing userlist and add some new members back to the same userlist?

-> You can do the same.

Thanks,

Abhinav Sharma

unread,
Apr 22, 2020, 9:17:07 AM4/22/20
to AdWords API and Google Ads API Forum
It does not seem like I can do the  as I am referring the post https://groups.google.com/forum/#!topic/adwords-api/mnPb2kCI2zo    and it clearly mentions that we need to remove all members from the user list and add the members back to the same user list If I need to use the same userlistId. please clarify this as it is very important for me to get the better understanding on this.

Abhinav Sharma

unread,
Apr 22, 2020, 9:45:11 AM4/22/20
to AdWords API and Google Ads API Forum
Sorry I didn't realize that you have raised the https://groups.google.com/forum/#!topic/adwords-api/mnPb2kCI2zo
It means I need to clear the whole user List and then add the members again. Correct me If I am wrong.

cv

unread,
Apr 22, 2020, 11:38:32 AM4/22/20
to AdWords API and Google Ads API Forum
Hi Abhinav,

That was my scenario.

I need to implement Replace as it is in UI.

Replace:

Replace your existing audience list by uploading a CSV file with a new set of customer data. You can use a template, or create your own CSV file with customer data using a combination of the required column headers below.


So, For that, I need SET functionality which was not supported.

In My case, I need to remove all members and need to add all members.

If I can remove and add all members then It is possible to have remove 100 members as well. 

Also you missed the 2nd point which says.

2)With the existing userListId, the new members would be appended to the existing user list. which will clear your point to ADD new 100 members.

So, I said It is possible.

Let's wait for an official reply from API

Google Ads API Forum Advisor Prod

unread,
Apr 22, 2020, 2:54:32 PM4/22/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi All,

Let me try and clear up the confusion.


Lets say, on First day I create a user list with 10K members. On second day If I want to add 100 members and remove 100 members from the same user List, Can I remove few members using MutateMembers() from the existing userlist and add some new members back to the same userlist?
Yes, this is possible using mutateMembers(). You can use the ADD operand and specify a membersList to add those members to your existing list. The same applies for the REMOVE operand.

I want to replace ALL of the members in my UserList.
This is where you would have to use the removeAll operand and then ADD. This is what my colleague Xiaoming was referring to.

The only thing not possible is editing the contents of a specific member of the UserList (such as changing the email of a member) since there's no SET operation available for mutateMembers.

Abhinav Sharma

unread,
May 22, 2020, 3:36:14 PM5/22/20
to AdWords API and Google Ads API Forum
Hi,

Thanks for the clarification. I have implemented the suggestion, however, I am stuck in one scenario.

I am uploading 1000 customer records in the existing user list (custom Audience) with the userListService.mutateMembers method. However, How should I handle the partial failure? e.g. if 10 records out of 1000 customer records fails to upload then does it mean that it is a complete failure of uploading the 1000 customer records or it is a partial failure for 10 records only (9990 records got uploaded successfully)? If it is partial upload then how should I handle the partial error records one by one?

thanks in advance.

Thanks,
Abhinav

Google Ads API Forum Advisor Prod

unread,
May 22, 2020, 7:30:02 PM5/22/20
to adwor...@googlegroups.com
Hi Abhinav,

You should make sure you have partial failures enabled when you make your call. With this enabled, all members will go through except the ones that fail. In terms of dealing with the failures, I would check if it's the same issue or different issues impacting them then try and troubleshoot them one by one. Here are the possible mutateMember errors. If you have any issues with that, feel free to share the error logs here via Reply privately to author and I can help you out.

Abhinav Sharma

unread,
May 23, 2020, 4:36:31 AM5/23/20
to AdWords API and Google Ads API Forum

Abhinav Sharma

unread,
May 23, 2020, 4:37:23 AM5/23/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Thanks for you quick response. I am stuck in one scenario where I am trying to add, update or delete the users (1000 in single request) from the existing user list (Audience) and trying to handle the partial failures.
below is code i have implemented:

using (var userListService =
                    (AdwordsUserListService) user.GetService(AdWordsService.v201809.AdwordsUserListService))
                {
                    //set the partial Failure as true
                    userListService.RequestHeader.partialFailure = true;

                    // Create operation to add members to the user list based on email
                    MutateMembersOperation mutateMembersOperation = new MutateMembersOperation
                    {
                        operand = new MutateMembersOperand
                        {
                            userListId = long.Parse(audienceId),
                            membersList = members.ToArray()
                        },
                        @operator = Operator.ADD
                    };

                    //Add members to the user list/audience based on the provided member list
                    MutateMembersReturnValue mutateMembersResult = userListService.mutateMembers(
                        new MutateMembersOperation[]
                        {
                            mutateMembersOperation
                        });
                }
            }
            catch (Exception e)
            {
                throw new System.ApplicationException(
                    "Failed to add user lists " +
                    "(a.k.a. audiences) and upload email addresses.", e);
            }

I was assuming to get the partialFailureErrors from the mutateMembersResult, however, counldn't get it. Could you please point me to the right direction if I am doing something wrong in the code to handle the partial failures.

Thanks,
Abhinav Sharma

cv

unread,
May 25, 2020, 5:20:54 AM5/25/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Is partial failure supported with UserListService Mutate operations?

I think it is not. I have also asked for the same but they reply with no. Link here

I have another question regarding partial failure and validate only but it seems not.


Thanks,

Google Ads API Forum Advisor Prod

unread,
May 26, 2020, 2:08:02 PM5/26/20
to adwor...@googlegroups.com
Hi Abhinav,

That code looks correct. Can you please share the detailed request and response logs via Reply privately to author so I can further investigate the issue?

@cv, partial failures should be supported for this operation. It looks like that forum post is in regards to validateOnly.

Abhinav Sharma

unread,
May 28, 2020, 2:59:25 PM5/28/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Is partial failure supported with UserListService Mutate operations?

I think it is not. @cv have also asked for the same but they replied NO. please refer Link here

Could you please clarify with the above question.

Thanks,
Abhinav

Google Ads API Forum Advisor Prod

unread,
May 28, 2020, 4:47:58 PM5/28/20
to adwor...@googlegroups.com
Hi Abhinav,

I can confirm that the UserList service supports partial failure as shown here. Also, for AdWords API, the AdWordsUserListService should support partial failures as well. Please let me know if that causes any errors.

Abhinav Sharma

unread,
May 29, 2020, 12:49:46 AM5/29/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Could you please help me out to implement the handlepartialfailure in below code. I am struggling lil bit here. I am not able to get the partialFailureErrors object from mutateMembersResult .

using (var userListService =
                    (AdwordsUserListService) user.GetService(AdWordsService.v201809.AdwordsUserListService))
                {
                    //set the partial Failure as true
                    userListService.RequestHeader.partialFailure = true;

                    // Create operation to add members to the user list based on email
                    MutateMembersOperation mutateMembersOperation = new MutateMembersOperation
                    {
                        operand = new MutateMembersOperand
                        {
                            userListId = long.Parse(audienceId),
                            membersList = members.ToArray()
                        },
                        @operator = Operator.ADD
                    };

                    //Add members to the user list/audience based on the provided member list
                    MutateMembersReturnValue mutateMembersResult = userListService.mutateMembers(
                        new MutateMembersOperation[]
                        {
                            mutateMembersOperation
                        });
                }
            }
            catch (Exception e)
            {
                throw new System.ApplicationException(
                    "Failed to add user lists " +
                    "(a.k.a. audiences) and upload email addresses.", e);
            }


Thanks,
Abhinav

cv

unread,
May 29, 2020, 5:07:00 AM5/29/20
to AdWords API and Google Ads API Forum
Hello Mitchell,

Your link also suggests that it would support both partial_failure and validate_only. But again your reply said that would for validate_only. We confused.

@abhinav I think API is not supporting the same.
I have also asked the same to the forum but they said to contact Google Ads Team.

Link here


Thanks,

Google Ads API Forum Advisor Prod

unread,
May 29, 2020, 2:34:42 PM5/29/20
to adwor...@googlegroups.com
Hi Abhinav,

Please see here for more information about getting the partial failure values and a more in depth example here. Please share your code if you are still having.

@cv, the documentation shows that both partial failure and validate only should be supported for that service. I will monitor that thread and take the appropriate action.

cv

unread,
May 31, 2020, 5:36:35 AM5/31/20
to AdWords API and Google Ads API Forum
Hello Abhinav,

This may clear all the doubts.

Good explanation here.

Thanks,

Abhinav Sharma

unread,
Jun 9, 2020, 6:20:56 AM6/9/20
to AdWords API and Google Ads API Forum
HI Mitchell,

as you mentioned earlier that partial failures are allowed in AdwordsUserListService. However when I am trying to add some users in the existing user list then I am not able to implement the partial failure. please refer below code and point out the area where we can implement the partial failure. 

try
            {
                using (var userListService =
                    (AdwordsUserListService) user.GetService(AdWordsService.v201809.AdwordsUserListService))
                {
                    //set the partial Failure as true
                    userListService.RequestHeader.partialFailure = true;

                    // Create operation to add members to the user list based on email
                    MutateMembersOperation mutateMembersOperation = new MutateMembersOperation
                    {
                        operand = new MutateMembersOperand
                        {
                            userListId = long.Parse(audienceId),
                            membersList = members.ToArray()
                        },
                        @operator = Operator.ADD
                    };

                    //Add members to the user list/audience based on the provided member list
                    MutateMembersReturnValue mutateMembersResult = userListService.mutateMembers(
                        new MutateMembersOperation[]
                        {
                            mutateMembersOperation
                        });
                }
            }
            catch (AdWordsApiException adWordsApiException)
            {
                var apiException = adWordsApiException.ApiException as ApiException;
                if (apiException != null)
                {
                    foreach (var apiExceptionError in apiException.errors)
                    {
                        
                    }
                }
            }
            catch (Exception e)
            {
                throw new System.ApplicationException(
                    "Failed to add user lists " +
                    "(a.k.a. audiences) and upload email addresses.", e);
            }


Thanks,
Abhinav

Abhinav Sharma

unread,
Jun 9, 2020, 6:56:15 AM6/9/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Appreciate if you can point out the code change required in the code which I have sent you in previous post.

In addition to this, i have seen the document https://developers.google.com/adwords/api/docs/guides/partial-failure#c which mentions below supported services for partial failure.

How do I get the partial failure support for AdwordsUserListService.

Thanks,
Abhinav

Google Ads API Forum Advisor Prod

unread,
Jun 9, 2020, 3:58:15 PM6/9/20
to adwor...@googlegroups.com
Hi Abhinav,

Can you please share the complete detailed request and response logs for your call via Reply privately to author so I can further investigate the issue? You can find information on enabling logging here. It looks like you have the right code to enable partial failure. You can handle the failed operations by following the example here. I understand that the AdWordsUserListService is not in that list but it should still work in the same way.
Message has been deleted

Google Ads API Forum Advisor Prod

unread,
Jun 10, 2020, 6:26:19 PM6/10/20
to adwor...@googlegroups.com
Hi Abhinav,

I removed your last post because it contained sensitive information. Please make sure to us the Reply privately to author option when sending logs and other sensitive data.

In terms of the issue, I am having my team look into it and will let you know when there's an update.

Google Ads API Forum Advisor Prod

unread,
Jun 11, 2020, 2:51:48 PM6/11/20
to adwor...@googlegroups.com
Hi Abhinav,

Thank you for your patience. I have received some updates from my team. It turns out there was some confusion and that the AdWordsUserListService actually does not support partial failures. However, the Google Ads API UserListService does support partial failures. Unfortunately, it is currently not possible to add members to a user list using the Google Ads API however there is an existing feature request for this so I would recommend keeping an eye on our Developer Blog for information on future releases.

Abhinav Sharma

unread,
Jun 12, 2020, 1:32:37 AM6/12/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Thanks for the update.

As per my knowledge the Google Ads API is in beta stage so that I can not use in production for the new development. Please correct me If I am wrong.

Thanks,
Abhinav

cv

unread,
Jun 12, 2020, 4:32:11 AM6/12/20
to AdWords API and Google Ads API Forum
Hello Mitchell,

Unfortunately, it is currently not possible to add members to a user list using the Google Ads API however there is an existing feature request for this so I would recommend keeping an eye on our Developer Blog for information on future releases.

-> Is this possible through Google Adwords API, right?
I was adding the Users email and Phone numbers on daily basis. 

Thanks,

Abhinav Sharma

unread,
Jun 12, 2020, 9:58:31 AM6/12/20
to AdWords API and Google Ads API Forum
@CV,

As per my understanding, google adwords api supports
1) addition of new customers in the existing customerList
2) removal of existing customer from the existing customerList

Google adwords api does not support the modification of the customer information (such as first name, last name, email, phone number and other address info) in the existing customerList.

@Mitchel, please confirm.

Thanks,
Abhinav

cv

unread,
Jun 12, 2020, 10:59:03 AM6/12/20
to AdWords API and Google Ads API Forum
Hi,

@abhinav,

Yes Correct.

@Mitchel,  We are waiting for official words.

Thanks

Google Ads API Forum Advisor Prod

unread,
Jun 12, 2020, 2:45:17 PM6/12/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi All,

@Abhinav, you are correct that Google Ads API is still in beta and not currently recommended for production use.

@cv, as Abhinav mentioned, adding and removing customers to a user list is possible using the AdWords API mutateMembers operation. As you said, you have already been doing this.

Abhinav Sharma

unread,
Jun 18, 2020, 3:41:41 AM6/18/20
to AdWords API and Google Ads API Forum
Hi There,

I am trying to perform two operation on existing customer list (audience)
1) Adding the customer (FirstName, LastName, Email, Phone, Country, Zip) to an existing customer list (Audience) - Which I am able to do that
2) Removing the existing customer from the same existing customer list (audience) - in the document it's mentioned that I need to set the mutate operator as REMOVE. however, Do I need to pass the same MEMBER object with all the customer info (FirstName, LastName, Email, Phone, Country, Zip) ? OR Is removal of the record is not possible via any external identifier (such as some ID for the old record)?



Thanks,
Abhinav

Google Ads API Forum Advisor Prod

unread,
Jun 18, 2020, 1:36:23 PM6/18/20
to adwor...@googlegroups.com
Hi Abhinav,

If you would like to remove a specific member, you should pass the full member object to the mutateMembers call.

Abhinav Sharma

unread,
Jun 25, 2020, 12:55:59 AM6/25/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

I have successfully added customers to the customer list (audience) however I am not able to see any match rate percentage populated when I manually check on my google ads manager portal(under Audience list)
It is bit different as uploading the customer list manually gives me the exact match rate percentage populated and I am able to see the match rate percentage on my google ads manager.

Is there anything specific I need to mention in my code to reflect the match rate.

Thanks,
Abhinav

Google Ads API Forum Advisor Prod

unread,
Jun 25, 2020, 1:46:11 PM6/25/20
to adwor...@googlegroups.com
Hi Abhinav,

The match rate should update automatically when you upload the new members. However, it can take up to 12 hours for the new members to be uploaded to the user list so I would recommend waiting at least that amount of time to check and see if the new match rate is correct.

Abhinav Sharma

unread,
Jun 28, 2020, 7:20:19 AM6/28/20
to AdWords API and Google Ads API Forum
Hi Mitchel,

Please refer below screenshot

testCapture'.PNG


first audience was uploaded by GoogleAdwordsApi and second audience was uploaded manually. I am not able to see any match rate for the first audience which was uploaded by API.

Thanks,
Abhinav

Google Ads API Forum Advisor Prod

unread,
Jun 29, 2020, 2:11:19 PM6/29/20
to adwor...@googlegroups.com
Hi Abhinav,

Can you please share your complete detailed request and response logs for the member upload via Reply privately to author so I can further investigate the issue? You can find information on enabling logging in the ReadMe of your client library.

Abhinav Sharma

unread,
Jul 6, 2020, 1:37:55 AM7/6/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

I have sent you the logs via Reply privately to author last week, however, didnt receive any response.

Could you please have a look and let me know.

Thanks,
Abhinav

Google Ads API Forum Advisor Prod

unread,
Jul 6, 2020, 2:43:47 PM7/6/20
to adwor...@googlegroups.com
Hi Abhinav,

The logs must not have gone through. Please try sending them directly to googleadsa...@google.com.

Philip Amendolia

unread,
Jan 13, 2021, 10:43:17 PM1/13/21
to AdWords API and Google Ads API Forum
Hi,

Using the Google Ads API RunOfflineUserDataJob service if I send 2 separate jobs synchronously, in order on my end, will the job cantaining the RemoveAll operation be executed before the job containing the Create operations?
The end goal is to "refresh" a Customer Match List". What I am trying to do currently: 

1. First job - uses the remove_all OfflineUserDataJobOperation to wipe a Customer Match Audience list, first job with a resource name i.e. 'customers/4925422580/offlineUserDataJobs/4354690227'.

2. Second job - uses the  create OfflineUserDataJobOperation to create operations for a new list of emails and runs the 2nd job, with a separate resource name i.e.  'customers/4925422580/offlineUserDataJobs/4354690227'

Can I be confident that the first job will be executed by Google before the 2nd job? Or is there a chance that the new user list will be uploaded first, and then the job with the remove all wipes that new user list?


As both jobs can take up to 24 hours, I can't exactly wait for a SUCCEEDED status from job 1 before proceeding to job 2. Can you offer any insight on this?

Google Ads API Forum Advisor Prod

unread,
Jan 14, 2021, 1:36:19 PM1/14/21
to philip.a...@epldigital.com, adwor...@googlegroups.com
Hello Philip,

Could you do me a huge favor and start a new forum thread with this question? It's already well written; it just needs to be in a new thread. The reason is because people who are on this thread or people coming along later may get confused when the question is slightly different than the original question, especially when the thread is old.

Thanks,
Nadine Wang, Google Ads API Team 

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