UserListError.CAN_NOT_MUTATE_SENSITIVE_USERLIST due to Customer Match policy?

412 views
Skip to first unread message

al...@zaius.com

unread,
Oct 24, 2018, 7:39:41 PM10/24/18
to AdWords API and Google Ads API Forum
I'm getting this exception when trying to mutate a user list. I have updated this list daily without failure up until today. Is the change to the Customer Match policy the culprit, or could it be something else?


Thanks!

Peter Oliquino (AdWords API Team)

unread,
Oct 25, 2018, 2:20:53 AM10/25/18
to AdWords API and Google Ads API Forum
Hi Alex,

So I can better investigate this issue, could you provide to me the complete SOAP request and response that was generated? You may reply to me via the Reply privately to author option.

Thanks and regards,
Peter
AdWords API Team

simprosys...@gmail.com

unread,
Oct 25, 2018, 7:06:47 AM10/25/18
to AdWords API and Google Ads API Forum
hi peter 

I have the same issue  when I try in PHP SDK given error php 


<?php
/**
 * Copyright 2017 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

namespace Google\AdsApi\Examples\AdWords\v201809\Remarketing;

require 'googleads-php-lib-master/vendor/autoload.php';

use Google\AdsApi\AdWords\AdWordsServices;
use Google\AdsApi\AdWords\AdWordsSession;
use Google\AdsApi\AdWords\AdWordsSessionBuilder;
use Google\AdsApi\AdWords\v201809\cm\Operator;
use Google\AdsApi\AdWords\v201809\rm\AddressInfo;
use Google\AdsApi\AdWords\v201809\rm\AdwordsUserListService;
use Google\AdsApi\AdWords\v201809\rm\CrmBasedUserList;
use Google\AdsApi\AdWords\v201809\rm\CustomerMatchUploadKeyType;
use Google\AdsApi\AdWords\v201809\rm\Member;
use Google\AdsApi\AdWords\v201809\rm\MutateMembersOperand;
use Google\AdsApi\AdWords\v201809\rm\MutateMembersOperation;
use Google\AdsApi\AdWords\v201809\rm\UserListOperation;
use Google\AdsApi\Common\OAuth2TokenBuilder;
use Google\AdsApi\AdWords\v201809\rm\UserListMembershipStatus;
use Google\AdsApi\AdWords\v201809\rm\AccessReason;
use Google\AdsApi\AdWords\v201809\rm\AccountUserListStatus;
use Google\AdsApi\AdWords\v201809\rm\UserListType;
/**
 * This example adds a user list (a.k.a. audience) and uploads members to
 * populate the list.
 *
 * <p><em>Note:</em> It may take up to several hours for the list to be
 * populated with members.
 * Email addresses must be associated with a Google account.
 * For privacy purposes, the user list size will show as zero until the list has
 * at least 1,000 members. After that, the size will be rounded to the two most
 * significant digits.
 */
class AddCrmBasedUserList{

    private static $EMAILS = [
    ];

    public static function runExample(AdWordsServices $adWordsServices,AdWordsSession $session,array $emails) {
        try{
            /*for($i=4;$i<=$n;$i++){
                $emails[]= str_replace("1",$i,"cust...@example.com");
            }*/
            $userListService = $adWordsServices->get($session, AdwordsUserListService::class);
            // Create a CRM based user list.
            $userList = new CrmBasedUserList();
            $userList->setName('test_for_customer_count' . uniqid());
            $userList->setDescription('A list of customers that originated from email addresses');
            $userList->setsizeRange("ONE_MILLION_TO_TWO_MILLION");
            $userList->setstatus(UserListMembershipStatus::OPEN);
            // CRM-based user lists can use a membershipLifeSpan of 10000 to
            // indicate unlimited; otherwise normal values apply.
            // Sets the membership life span to 30 days.
            $userList->setMembershipLifeSpan(365);
            $userList->setUploadKeyType(CustomerMatchUploadKeyType::CONTACT_INFO);
            $userList->setaccessReason(AccessReason::SHARED);
            $userList->setaccountUserListStatus(AccountUserListStatus::ACTIVE);
            $userList->setlistType(UserListType::CRM_BASED);
            
            // Create a user list operation and add it to the list.
            $operations = [];
            $operation = new UserListOperation();
            $operation->setOperand($userList);
            $operation->setOperator(Operator::ADD);
            $operations[] = $operation;

            // Create the user list on the server and print out some information.
            $userList = $userListService->mutate($operations)->getValue()[0];
            printf("User list with name '%s' and ID %d was added.\n",$userList->getName(),$userList->getId());
            // Create operation to add members to the user list based on email
            // addresses.

            $mutateMembersOperations = [];
            $mutateMembersOperation = new MutateMembersOperation();
            $operand = new MutateMembersOperand();
            $operand->setUserListId($userList->getId());
            $members = [];
            // Hash normalized email addresses based on SHA-256 hashing algorithm.
            /*foreach ($emails as $email) {
                $memberByEmail = new Member();
                $memberByEmail->setHashedEmail(self::normalizeAndHash($email));
                $members[] = $memberByEmail;
            }*/

            $n=40;
            for($i=4;$i<=$n;$i++){
                $emails[]= str_replace("1",$i,"cust...@gmail.com");
               // $email= str_replace("1",$i,"cust...@example.com");
                $memberByEmail = new Member();
                $memberByEmail->setHashedEmail(self::normalizeAndHash($email));
                $members[] = $memberByEmail;
            }

            $firstName = 'John';
            $lastName = 'Doe';
            $countryCode = 'US';
            $zipCode = '10011';

            $addressInfo = new AddressInfo();
            // First and last name must be normalized and hashed.
            $addressInfo->setHashedFirstName(self::normalizeAndHash($firstName));
            $addressInfo->setHashedLastName(self::normalizeAndHash($lastName));
            // Country code and zip code are sent in plain text.
            $addressInfo->setCountryCode($countryCode);
            $addressInfo->setZipCode($zipCode);

            $memberByAddress = new Member();
            $memberByAddress->setAddressInfo($addressInfo);
            $members[] = $memberByAddress;

            // Add members to the operand and add the operation to the list.
            $operand->setMembersList($members);
            $mutateMembersOperation->setOperand($operand);
            $mutateMembersOperation->setOperator(Operator::ADD);
            $mutateMembersOperations[] = $mutateMembersOperation;

            // Add members to the user list based on email addresses.
            $result = $userListService->mutateMembers($mutateMembersOperations);

            // Print out some information about the added user list.
            // Reminder: it may take several hours for the list to be populated with
            // members.
            foreach ($result->getUserLists() as $userList) {
                printf(
                    "%d email addresses were uploaded to user list with name '%s'"
                    . " and ID %d and are scheduled for review.\n",
                    count($emails),
                    $userList->getName(),
                    $userList->getId()
                );
            }
        }catch(\Exception $e){
            echo "<pre>";
            print_r($e);
        }
    }

    private static function normalizeAndHash($value){
        return hash('sha256', strtolower(trim($value)));
    }
    public static function main(){
        // Generate a refreshable OAuth2 credential for authentication.
         
         $oauth_2_credential =(new OAuth2TokenBuilder())
            ->withClientId("xxxxxxx")
            ->withClientSecret("xxxxxxxx")
            ->withRefreshToken("xxxxxxxx")
            ->build();

        // Construct an API session configured from a properties file and the
        // OAuth2 credentials above.

        $session = (new AdWordsSessionBuilder())
                ->withDeveloperToken("xxxxxxxxxx")
                ->withOAuth2Credential($oauth_2_credential)
                ->withClientCustomerId("xxxxxxx4")
                ->build();
        self::runExample(new AdWordsServices(), $session, self::$EMAILS);
    }
}
AddCrmBasedUserList::main();
?>

Errror 

Google\AdsApi\AdWords\v201809\cm\ApiException Object
(
    [errors:protected] => Array
        (
            [0] => Google\AdsApi\AdWords\v201809\rm\UserListError Object
                (
                    [reason:protected] => USER_LIST_SERVICE_ERROR
                    [fieldPath:protected] => operations[0].operand
                    [fieldPathElements:protected] => Array
                        (
                            [0] => Google\AdsApi\AdWords\v201809\cm\FieldPathElement Object
                                (
                                    [field:protected] => operations
                                    [index:protected] => 0
                                )

                            [1] => Google\AdsApi\AdWords\v201809\cm\FieldPathElement Object
                                (
                                    [field:protected] => operand
                                    [index:protected] => 
                                )

                        )

                    [trigger:protected] => 
                    [errorString:protected] => UserListError.ADVERTISER_NOT_WHITELISTED_FOR_USING_UPLOADED_DATA
                    [ApiErrorType:protected] => UserListError
                    [parameterMap:Google\AdsApi\AdWords\v201809\cm\ApiError:private] => Array
                        (
                            [ApiError.Type] => ApiErrorType
                        )

                )

        )

    [message1:protected] => [UserListError.ADVERTISER_NOT_WHITELISTED_FOR_USING_UPLOADED_DATA @ operations[0].operand]
    [ApplicationExceptionType:protected] => 
    [parameterMap:Google\AdsApi\AdWords\v201809\cm\ApplicationException:private] => Array
        (
            [ApplicationException.Type] => ApplicationExceptionType
        )

    [message:protected] => [UserListError.ADVERTISER_NOT_WHITELISTED_FOR_USING_UPLOADED_DATA @ operations[0].operand]
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /var/www/html/google_audience_manager/googleads-php-lib-master/src/Google/AdsApi/Common/Util/Reflection.php
    [line:protected] => 43
    [trace:Exception:private] => Array
       

Joana Esteves

unread,
Oct 25, 2018, 7:21:48 AM10/25/18
to AdWords API and Google Ads API Forum
https://support.google.com/adspolicy/answer/9158709?hl=en&ref_topic=29265
not sure if you saw this ^

We have the same since yesterday, our audiences are signalised with a warning/message Disabled due to policy violation in the UI of Google Ads
and we cannot update or create new customer lists :/

I don't have an answer, but that is the most relevant info that I found

al...@zaius.com

unread,
Oct 25, 2018, 1:45:24 PM10/25/18
to AdWords API and Google Ads API Forum
For reference, here's the SOAP request/response I sent to Peter:

Request:

<?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201806" xmlns:wsdl="https://adwords.google.com/api/adwords/rm/v201806" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Header> <wsdl:RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201806"> <userAgent>rails (AwApi-Ruby/1.3.0, Common-Ruby/1.0.2, GoogleAdsSavon/1.0.3, ruby/2.2.10, HTTPI/2.4.1, httpclient)</userAgent> <developerToken>REDACTED</developerToken> <clientCustomerId>**********</clientCustomerId> </wsdl:RequestHeader> </env:Header> <env:Body> <mutateMembers xmlns="https://adwords.google.com/api/adwords/rm/v201806"> <operations> <ns0:operator>ADD</ns0:operator> <operand> <userListId>**********</userListId> <membersList> <hashedEmail>**********</hashedEmail> </membersList> </operand> </operations> </mutateMembers> </env:Body> </env:Envelope>


Response:

<?xml version="1.0" encoding="UTF-8"?> <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>0005791104dbdce00a8112908a08ecd0</requestId> <serviceName>AdwordsUserListService</serviceName> <methodName>mutateMembers</methodName> <operations>1</operations> <responseTime>262</responseTime> </ns2:ResponseHeader> </soap:Header> <soap:Body> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>[UserListError.CAN_NOT_MUTATE_SENSITIVE_USERLIST @ operations[0].operand]</faultstring> <detail> <ns2:ApiExceptionFault xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201806" xmlns="https://adwords.google.com/api/adwords/cm/v201806"> <message>[UserListError.CAN_NOT_MUTATE_SENSITIVE_USERLIST @ operations[0].operand]</message> <ApplicationException.Type>ApiException</ApplicationException.Type> <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:UserListError"> <fieldPath>operations[0].operand</fieldPath> <fieldPathElements> <field>operations</field> <index>0</index> </fieldPathElements> <fieldPathElements> <field>operand</field> </fieldPathElements> <trigger /> <errorString>UserListError.CAN_NOT_MUTATE_SENSITIVE_USERLIST</errorString> <ApiError.Type>UserListError</ApiError.Type> <ns2:reason>CAN_NOT_MUTATE_SENSITIVE_USERLIST</ns2:reason> </errors> </ns2:ApiExceptionFault> </detail> </soap:Fault> </soap:Body> </soap:Envelope>

Thanet Knack Praneenararat (AdWords API Team)

unread,
Oct 26, 2018, 2:54:39 AM10/26/18
to AdWords API and Google Ads API Forum
Hello Alex,

Thanks for reporting this.
I'm passing this information to engineering and we'll update this thread as soon as possible.

Best,
Thanet, AdWords API Team

a...@audigent.com

unread,
Oct 26, 2018, 7:17:46 PM10/26/18
to AdWords API and Google Ads API Forum
We're having the same issue. Many of our audiences are showing up as "Closed" in AdX.  We're curious if something has changed, and we can't mutate them to status 'OPEN' because we're receiving this error when we try to update.

Thanet Knack Praneenararat (AdWords API Team)

unread,
Oct 29, 2018, 3:11:59 AM10/29/18
to AdWords API and Google Ads API Forum
Hello,

I'm not 100% sure if that is related to this issue or not.
Could you please open a new thread with your details so our team can help separately?
Thanks.

Best,
Thanet

al...@zaius.com

unread,
Nov 1, 2018, 4:19:33 PM11/1/18
to AdWords API and Google Ads API Forum
Hi Thanet,

Checking to see if there's been an investigation into this. Thanks!

Thanet Knack Praneenararat (AdWords API Team)

unread,
Nov 2, 2018, 2:46:13 AM11/2/18
to AdWords API and Google Ads API Forum
Hello Alex,

I'm in the middle of conversation with Engineering.
Please hang in there. :)

Best,
Thanet, AdWords API Team

al...@zaius.com

unread,
Nov 14, 2018, 3:08:33 PM11/14/18
to AdWords API and Google Ads API Forum
Pinging this thread, as it's been awhile. This is continually affects a large number of our user lists. Any word from engineering?

Thanet Knack Praneenararat (AdWords API Team)

unread,
Nov 15, 2018, 3:35:53 AM11/15/18
to AdWords API and Google Ads API Forum
Hello Alex,

Sorry for the late reply.
I've confirmed that, by the Customer Match policy update, all accounts need to get whitelisted first before using the customer match (CrmBasedUserList).
So, in case you own the accounts, please contact your Google representative for whitelisting. 
If not, you would need to tell the owners of accounts that you want to create the Customer Match on to do so.

See this page for whitelisting eligibility.

Best,
Thanet, AdWords API Team
Reply all
Reply to author
Forward
0 new messages