import users contacts via Google Ads API Python

104 views
Skip to first unread message

Roman

unread,
Oct 27, 2022, 6:38:36 AM10/27/22
to Google Ads API and AdWords API Forum
Hi! Im struggling with finding a correct way to work with Google Ads segments. I have clients emails and phones, and I need to import them into Google Ads using API. Can you please point me at concrete API method that would do the same thing that I can do without using API (attached screenshot). I guess the main question is how to import file to a segment using API, I mean where exactly in code I need to do it. Im working with Python
Screenshot_4.png

Google Ads API Forum Advisor

unread,
Oct 27, 2022, 10:13:51 AM10/27/22
to r.sv...@medianation.ru, adwor...@googlegroups.com

Hi Roman,

Thanks for reaching out to the Google Ads API Forum.

To upload the clients emails and phones to import them into Google Ads via Google Ads API, you may refer to this guide. Also, you may get started with our supported official client libraries here: https://developers.google.com/google-ads/api/docs/client-libs

Since you are looking to configure using Python, you may refer to this code example in the Remarketing folder of your client library. Also, for you to know more about OfflineUserDataJobService for managing customer match or user list, you may check here: https://developers.google.com/google-ads/api/reference/rpc/v12/OfflineUserDataJobService

Let us know if you have any questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2fokJS:ref

Roman

unread,
Oct 28, 2022, 10:34:48 AM10/28/22
to Google Ads API and AdWords API Forum

Hi again! Tell me please is it a right logic to work with multiple emails? Is it right that in this case (user_identifier_with_hashed_emails.hashed_email = self.normalize_and_hash(email)   ) user_identifier_with_hashed_emails stores normalized and hashed emails after each iteration so that it is not overwriting each time? 

Second question: lets imagine a case when I uploaded a user list and then used this list as a segment in a specific ad in a random campaign. One day later I decided to refresh this segment with new contacts by deleting old contacts first and then uploading a new set of contacts. So the question is what is going to happen to an ad? Will it stop working because of this little time gap when contacts were removed? If so, how I can avoid it? 
четверг, 27 октября 2022 г. в 17:13:51 UTC+3, adsapi:
Screenshot_1.png

Google Ads API Forum Advisor

unread,
Oct 28, 2022, 12:36:58 PM10/28/22
to r.sv...@medianation.ru, adwor...@googlegroups.com
Hi Roman,

Thank you for your follow up question. You may refer below for my responses :


Tell me please is it a right logic to work with multiple emails? Is it right that in this case (user_identifier_with_hashed_emails.hashed_email = self.normalize_and_hash(email)   ) user_identifier_with_hashed_emails stores normalized and hashed emails after each iteration so that it is not overwriting each time?

When working with multiple emails, you may refer to this earlier blog post, on how you can specify them as user identifiers. Also, it is correct that hashing should be performed per each  email.


Second question: lets imagine a case when I uploaded a user list and then used this list as a segment in a specific ad in a random campaign. One day later I decided to refresh this segment with new contacts by deleting old contacts first and then uploading a new set of contacts. So the question is what is going to happen to an ad? Will it stop working because of this little time gap when contacts were removed? If so, how I can avoid it?

Our team specializes in the implementation and troubleshooting of the API's customer match feature. What happens in production such as the ads' performances while changes are being applied (whether via the API or the UI) to the audiences, is unfortunately outside of our API team's scope. That said, for this item, I would recommend that you clarify this instead with the Google Ads Product Support team, via this link.

I hope this helps.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


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