Can't delete users using v201806's AdwordsUserListService

155 views
Skip to first unread message

Pablo D.

unread,
Dec 3, 2018, 6:05:26 PM12/3/18
to AdWords API and Google Ads API Forum
Hey, everyone! I'm trying to automate user deletion from our Customer Lists at Google Ads for GDPR compliance matters.

I couldn't get a positive response from Google's API. Data below.

URL:
Body Payload:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">

   <Header>

     <RequestHeader xmlns="https://adwords.google.com/api/adwords/rm/v201806">

       <userAgent></userAgent>

       <developerToken>{DEV_TOKEN_HERE}</developerToken>

       <clientCustomerId>{CLIENT_CUSTOMER_ID_HERE}</clientCustomerId>

     </RequestHeader>

   </Header>

   <Body xmlns="http://schemas.xmlsoap.org/soap/envelope/">

     <mutateMembers xmlns="https://adwords.google.com/api/adwords/rm/v201806">

       <operations>

         <operator xmlns="https://adwords.google.com/api/adwords/cm/v201806">REMOVE</operator>

         <operand>

           <userListId xmlns="https://adwords.google.com/api/adwords/rm/v201806”>{MY_USER_LIST_ID}</userListId>

           <membersList xmlns="https://adwords.google.com/api/adwords/rm/v201806">

             <hashedEmail>{MY_HASHED_EMAIL_TO_BE_REMOVED}</hashedEmail>

           </membersList>

         </operand>

       </operations>

     </mutateMembers>

   </Body>

</Envelope>


Response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   
<soap:Header>
       
<ns2:ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201806" xmlns="https://adwords.google.com/api/adwords/cm/v201806">
           
<requestId>{requestID}</requestId>
           
<serviceName>AdwordsUserListService</serviceName>
           
<methodName>mutateMembers</methodName>
           
<operations>1</operations>
           
<responseTime>245</responseTime>
       
</ns2:ResponseHeader>
   
</soap:Header>
   
<soap:Body>
       
<soap:Fault>
           
<faultcode>soap:Client</faultcode>
           
<faultstring>[MutateMembersError.INVALID_USER_LIST_ID @ operations[0].operand.userListId; trigger:'UserListId: {MY_USER_LIST_ID}']</faultstring>
           
<detail>
               
<ns2:ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201806" xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201806">
                   
<message>[MutateMembersError.INVALID_USER_LIST_ID @ operations[0].operand.userListId; trigger:'UserListId: {MY_USER_LIST_ID}']</message>
                   
<ApplicationException.Type>ApiException</ApplicationException.Type>
                   
<errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:MutateMembersError">
                       
<fieldPath>operations[0].operand.userListId</fieldPath>
                       
<fieldPathElements>
                           
<field>operations</field>
                           
<index>0</index>
                       
</fieldPathElements>
                       
<fieldPathElements>
                           
<field>operand</field>
                       
</fieldPathElements>
                       
<fieldPathElements>
                           
<field>userListId</field>
                       
</fieldPathElements>
                       
<trigger>UserListId: {MY_USER_LIST_ID}</trigger>
                       
<errorString>MutateMembersError.INVALID_USER_LIST_ID</errorString>
                       
<ApiError.Type>MutateMembersError</ApiError.Type>
                       
<ns2:reason>INVALID_USER_LIST_ID</ns2:reason>
                   
</errors>
               
</ns2:ApiExceptionFault>
           
</detail>
       
</soap:Fault>
   
</soap:Body>
</soap:Envelope>

Note:
Values between curly brackets are valid. Actually, {MY_USER_LIST_ID} could be any item from the response of the following query:
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
   
<Header>
     
<RequestHeader xmlns="https://adwords.google.com/api/adwords/rm/v201806">
       
<userAgent></userAgent>
       
<developerToken>{DEV_TOKEN_HERE}</developerToken>
       
<clientCustomerId>{CLIENT_CUSTOMER_ID_HERE}</clientCustomerId>
     
</RequestHeader>
   
</Header>
   
<Body xmlns="http://schemas.xmlsoap.org/soap/envelope/">
     
<get xmlns="https://adwords.google.com/api/adwords/rm/v201806">
       
<serviceSelector xmlns="https://adwords.google.com/api/adwords/rm/v201806">
         
<fields>Id</fields>
         
<fields>Name</fields>
         
<fields>Status</fields>
         
<predicates>
           
<field>ListType</field>
           
<operator>EQUALS</operator>
           
<values>CRM_BASED</values>
         
</predicates>
         
<predicates>
           
<field>Status</field>
           
<operator>EQUALS</operator>
           
<values>OPEN</values>
         
</predicates>
       
</serviceSelector>
     
</get>
   
</Body>
</Envelope>

Any ideas on this? Thank you!

Dannison Yao (AdWords API Team)

unread,
Dec 4, 2018, 12:49:35 AM12/4/18
to AdWords API and Google Ads API Forum
Hi Pablo,

The error INVALID_USER_LIST_ID is encountered when you are trying to mutate a user list Id that does not belong to your account. Could you try running the AdwordsUserListService.get() and see if the results will return the user list Id you have specified? 

If it was not returned, this means that the user list id you specified does not belong to the account you are using.

Regards,
Dannison
AdWords API Team

Pablo D.

unread,
Dec 4, 2018, 5:44:14 AM12/4/18
to AdWords API and Google Ads API Forum
Indeed, on my original post, the latest code block shows the query I've been doing for AdwordsUserListService.get(). It returns (in my specific case) 3 different user lists. Although they all have the following XML property:

  <ns2:isReadOnly>true</ns2:isReadOnly>


As I read on the docs, this value 
[...] Depends on the list ownership and list type. For example, external remarketing user lists are not editable.

I believe that manually uploaded User Lists (presented as CrmBasedUserLists within the API) should be editable.
I'll try to meet with our Marketing Team for a further explanation since I don't have this specific knowledge on these Remarketing concepts.


In any case, I'm asking this because I'm working on integrating a solution to comply with customers' right to be forgotten. Maybe there's another way to mass delete user data from Google Products (or at least Google Ads) using a simpler approach, than querying every user lists and performing memberLists mutations for each of them.
If that's the case, could you please point me out where can I find more information, Dannison?

Thanks a lot!

Dannison Yao (AdWords API Team)

unread,
Dec 4, 2018, 9:35:33 PM12/4/18
to AdWords API and Google Ads API Forum
Hi Pablo,

According to this blog post, an account needs to be whitelisted to perform CrmBasedUserList operations. Could you confirm if your account has already been whitelisted for this? Could you also provide the complete SOAP request and response logs in your initial post without redacting any information so I could investigate this further? You may use the Reply private to author option.

Regards,
Dannison
AdWords API Team

Pablo D.

unread,
Dec 7, 2018, 4:02:56 AM12/7/18
to AdWords API and Google Ads API Forum
Hi Dannison,

It seems it was a permissions issue. I was trying to perform actions on a shared user list, using the clientCustomerId that wasn't the owner of those lists.

Thank you!
Reply all
Reply to author
Forward
0 new messages