How to add multiple records to members in AdwordsUserListService for customer matching?

110 views
Skip to first unread message

abhi

unread,
Jun 17, 2020, 6:05:24 PM6/17/20
to AdWords API and Google Ads API Forum
the documentation shows :
  emails = ['cust...@example.com', 'cust...@example.com',
           
' Cust...@example.com ']
  members
= [{'hashedEmail': NormalizeAndSHA256(email)} for email in emails]

 
# Add address info.
  members
.append({
     
'addressInfo': {
         
# First and last name must be normalized and hashed.
         
'hashedFirstName': NormalizeAndSHA256('John'),
         
'hashedLastName': NormalizeAndSHA256('Doe'),
         
# Country code and zip code are sent in plaintext.
         
'countryCode': 'US',
         
'zipCode': '10001'
     
}
  }) 
in this does all the 3 emails belong to same member mentioned in the address info, if not how to add to members list for multiple records

Google Ads API Forum Advisor Prod

unread,
Jun 18, 2020, 10:10:50 AM6/18/20
to abhishek...@gmail.com, adwor...@googlegroups.com
Hi Abhi,

Thank you for reaching out. In this example, each entity in the "members" array will be a unique member. This means that each email address represents a unique member and also the address info represents a 4th unique member.

This user list has a "contact info" identifier meaning that members can be added by email, phone number, or address as explained here.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5004Q217MPU:ref

abhi

unread,
Jun 18, 2020, 11:08:31 AM6/18/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Thanks for the clarification on that. I think my question would now have more clarity, suppose I have 1 email, 3 phone numbers, first_name, last_name, country and zip for every member, how do I add it in the member list for more than 1 member record using the AdwordsUserListService? I read the docs, but that didn't help me in understanding that for the above case


Thanks,
Abhi

Abhinav Sharma

unread,
Jun 18, 2020, 11:59:24 AM6/18/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Adding to Abhi's question. 
He mentioned a scenario where we have 1 customer related record in our CRM based list (1 email, 3 phone numbers, first_name, last_name, country and zip). 
Suppose the customer info is:
2) phone1: 0123456789
3) phone2: 0123456785
4) phone3: 0125364786
5) first_name: abhinav
6) last_name: sharma
7) country: AU
8) zip: 3000

how many MEMBER objects should we create in the above scenario?

will it be 3 member objects specifying 3 different hashedPhoneNumber properties and add the above email and addressinfo in the same 3 MEMBER objects?

OR will it be 5 different MEMBER objects (one for email, one for phone1, one for phone2, one for phone3 and one for addressInfo)?

Thanks,
Abhinav

Google Ads API Forum Advisor Prod

unread,
Jun 18, 2020, 3:08:50 PM6/18/20
to adwor...@googlegroups.com
Hi Abhi and Abhinav,

@Abhi, I'm still a little confused by your scenario. Every member can have a maximum of 1 email address, 1 address, and 1 phone number. If you have three emails, you should create three separate members with all of the information the same except for the email address. Then, you should create a MembersList object and add the members to it as shown in the example code you sent earlier.

@Abhinav, you can create 3 members in this scenario, each with a different phone number but containing the email address and address.

abhi

unread,
Jun 18, 2020, 4:56:55 PM6/18/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Thanks for clearing that up, now I know that when there is more than one email or phone number for same person, it has to be sent as different members with change in email or phone number.

also, please correct me if I am wrong, is this how the members list would look like when same person has 2 emails?

[{'hashedEmail': self.normalize_and_sha256('cust...@example.com'),
                       
'hashedPhoneNumber': self.normalize_and_sha256('+1999999999'),
                       
'addressInfo': {
                           
'hashedFirstName': self.normalize_and_sha256('John'),
                           
'hashedLastName': self.normalize_and_sha256('Doe'),

                           
'countryCode': 'US',
                           
'zipCode': '10001'

                       
}}, {'hashedEmail': self.normalize_and_sha256('cust...@example.com'),
                             
'hashedPhoneNumber': self.normalize_and_sha256('+1999999999'),


                             
'addressInfo': {
                                 
'hashedFirstName': self.normalize_and_sha256('John'),
                                 
'hashedLastName': self.normalize_and_sha256('Doe'),

                                 
'countryCode': 'US',
                                 
'zipCode': '10001'

                             
}}]

Thanks,
Abhi

Google Ads API Forum Advisor Prod

unread,
Jun 19, 2020, 10:34:18 AM6/19/20
to abhishek...@gmail.com, adwor...@googlegroups.com
Hi Abhi,

Yes, that looks good. Just make sure they're being added to the membersList as separate members.

abhi

unread,
Jun 22, 2020, 11:18:35 AM6/22/20
to AdWords API and Google Ads API Forum
Hi Mitchell,

Thanks for the input, I just have another question, how does the customer matching list handle duplicates? like what would happen if I am adding a member that already exists in the list, would it get added or the will the duplicate be ignored?

Google Ads API Forum Advisor Prod

unread,
Jun 22, 2020, 1:49:14 PM6/22/20
to abhishek...@gmail.com, adwor...@googlegroups.com
Hi Abhi,

If you try and add a duplicate member to a user list, the API call will not fail but the duplicate entry will be ignored.

abhi

unread,
Jun 22, 2020, 2:02:37 PM6/22/20
to AdWords API and Google Ads API Forum
Thanks for answering all of my questions


Thanks,
Abhi
Reply all
Reply to author
Forward
0 new messages