How to send more than one userIdentifier in UserList in REST

66 views
Skip to first unread message

Prithwish Hati

unread,
Dec 23, 2024, 9:59:27 AM12/23/24
to Google Ads API and AdWords API Forum
I'm using `offlineDataJobs` to populate a `userList`. When I try to add `hashedEmail` and `hashedPhoneNumber` inside one user, it shows an error that only one identifier can exist per user. 

My doubt is, how can I send other user details like email, name etc for each user?

Screenshot 2024-12-21 201527.png

Google Ads API Forum Advisor

unread,
Dec 23, 2024, 12:33:30 PM12/23/24
to hatipr...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

In the Google Ads API, the "user_identifier" field can only contain one user identification field, like a hashed email, hashed phone number, or mobile ID. Providing multiple identification fields within the "user_identifier" will result in an invalid entry. If you have more than one UserIdentifier for the userlist. Add a separate UserIdentifier object for each identifier. For example, a record with an email address and a phone number results in a UserData object with two UserIdentifier objects. I would recommend you to check the documentation Design your integration for more information.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGqD4:ref" (ADR-00279600)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Prithwish Hati

unread,
Dec 24, 2024, 9:53:33 AM12/24/24
to Google Ads API and AdWords API Forum
I've added 2 userIdentifiers objects, now I'm seeing 400 error with message: Invalid JSON payload received. Expected a value.\n true\r\n}\n^ and status: INVALID_ARGUMENT. Can you please tell me what I'm doing wrong here?
  
{
"validateOnly": true,
  "operations": [
    {
      "create": {
        "consent": {
          "adPersonalization": "GRANTED",
          "adUserData": "GRANTED"
        },
        "userIdentifiers": [
            {
                "hashedEmail": ""
            },
            {
                "hashedPhoneNumber": ""
            }
        ]
      }
    }
  ],
  "enablePartialFailure": true,
  "enableWarnings": true
}

Google Ads API Forum Advisor

unread,
Dec 24, 2024, 11:49:44 AM12/24/24
to hatipr...@gmail.com, adwor...@googlegroups.com

Hi,

In order to assist you further, please provide the complete API logs (request and response with request-id and request header) generated at your end for the request present in the screenshot without redacting any information.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option or direct private reply to this email.

Prithwish Hati

unread,
Dec 26, 2024, 8:13:32 AM12/26/24
to Google Ads API and AdWords API Forum
Here's the API Log:

Screenshot 2024-12-26 122235.png

Google Ads API Forum Advisor

unread,
Dec 26, 2024, 11:43:04 AM12/26/24
to hatipr...@gmail.com, adwor...@googlegroups.com

Hi,

Please note that we are requesting for the logs that are generated by the Google Ads API while executing a mutate operation. The Google Ads API logs contain request, response, request-id and request header. The screenshot shared by you does not contain the information that we are expecting. In order to assist you further, please share the complete API logs. Also, I noticed that you have redacted some information like customer Id in the screenshot shared. While sharing the complete API logs, kindly do not redact any information as we require those details for investigating your issue.

Prithwish Hati

unread,
Dec 27, 2024, 7:20:09 AM12/27/24
to Google Ads API and AdWords API Forum
Thanks. My problem was solved. After logging the api call properly, I figured out I wasn't hashing the phone number with country code, that was the issue.

Thanks a lot for your help.
Reply all
Reply to author
Forward
0 new messages