Adding mobile Ids to CrmBasedUserList through APIs isn't reflected into Google Ads site

2020-12-11 Thread sejin jang
Hi there,

Below is an implemented Python code to upload Mobile Device Ids through API 
for remarketing.

But, customer List Id(*6534339977*) shows its size shows still 0 even 
though the number of uploaded mobile device Ids is much more than 1,000.

Would there be anyone who can help? 

* ATTACHED PYTHON SNIPPET
def send_google_mobile_device_id(df, country_code):
"""Adds a user list and populates it with hashed email addresses.
Note: It may take 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 1000 
members. After
that, the size will be rounded to the two most significant digits.
"""
def validate_idfa_format(idfa):
idfa_splited = idfa.split('-')
if [len(ele) for ele in idfa_splited] == [8, 4, 4, 4, 12]:
return True
else:
return False

# CREDENTIAL & AUTHENTICATE, with yaml
gg_config = Config('cro', 'prod', False, True).get_read('googleads')

with open("yaml", "w") as f:
f.write(f"adwords:\n")
f.write(f"   developer_token: {gg_config['developer_token']}\n")
f.write(f"   client_id: {gg_config['client_id']}\n")
f.write(f"   client_secret: {gg_config['client_secret']}\n")
f.write(f"   refresh_token: {gg_config['refresh_token']}\n")
f.close()
client = adwords.AdWordsClient.LoadFromStorage('yaml')

today = date.today()
print("As of:", today)

# CREATE A USER LIST
cro_app_info = {"AOS": "com.devsisters.gb", "iOS": "963067330"}
for os in ['AOS', 'iOS']:
user_list = {
'xsi_type': 'CrmBasedUserList',
'name': f'Mobile Device ID({os}) as of {today}_{country_code}',
'description': f'CRO Mobile Device IDs({os})',
'uploadKeyType': 'MOBILE_ADVERTISING_ID',
'appId': cro_app_info[os]
  }

# Create an operation to add the user list.
operations = [{
'operator': 'ADD',
'operand': user_list
}]

# Call User List Service
user_list_service = client.GetService('AdwordsUserListService', 
'v201809')
result = user_list_service.mutate(operations)

# Organize Mobile Device IDs from files
user_list_id = result['value'][0]['id']
members = [{'mobileId': mobile_id} for mobile_id in df["Mobile 
Device ID"].tolist() if validate_idfa_format(mobile_id) == True]

# Send User List
n = 0
cut_off = int(4 * 1e5)
for i in range(int(len(members)/cut_off) + 1):
members_split = members[i * cut_off: (i + 1)*cut_off]
n += len(members_split)

# Form into JSON
mutate_members_operation = {
  'operand': {
  'userListId': user_list_id,
  'membersList': members_split
  },
  'operator': 'ADD'
}

# Upload seeds through API
response = 
user_list_service.mutateMembers([mutate_members_operation])

if 'userLists' in response:
print(f'a {n} number of User list with name {user_list["name"]} 
has been added.')

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/f39eeaa2-8dad-43e4-83a1-c7750d949e45n%40googlegroups.com.


Any Python Snippets to Upload a User List(Customer Match) with Mobile Device IDs for Re-marketing?

2020-12-07 Thread sejin jang
Hello,

What I've wondered so far is if there is a way to *substitute* uploading 
csv files(containing Mobile Device IDs) manually to create a list(for 
remarketing) *with* using APIs(or etc.) *as below*.

https://developers.google.com/adwords/api/docs/guides/remarketing#customer_match_with_mobile_device_ids

Let me share my plan to do this.
After extracting Mobile Device IDs from our own database, we'd like to 
directly send this info to Google side through Google Ads APIs.
(Currently, we extract tons of files from the database, and upload these 
one by one, *which takes a huge while T.T*)

Is there any *Python snippet*, doing this?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/61c8527f-5f01-4870-8bca-f9cad4901fc0n%40googlegroups.com.


Re: Country Code cannot be retrieved for App Campaign

2020-06-18 Thread sejin jang
I re-post my question again since uploading picture through reply is not 
possible.
Google Group itself seems very unstable.


On Friday, June 19, 2020 at 9:40:25 AM UTC+9, sejin jang wrote:
>
> There seem uploading picture is not possible.
> Can you guide me how to upload?
>
> I m trying from Google Groups Conversation.
>
> Regards, 
> Sejin
>
> On Friday, June 19, 2020 at 9:34:12 AM UTC+9 sejin...@devsisters.com 
> wrote:
>
>> Dears,
>>
>> Please refer to the attached.
>>
>>
>> *Google Groups*  seems unstable when to upload and reply.
>> Let me just add my situation.
>>
>> Below is the report through *Google Ads.*
>> Under *CRO_WW_Puchase* campaign, each location (Thailand, United States) 
>> can be seen.
>>
>>
>> However,  retrieving the info. using API gives non-location data as 
>> below, called as *"--" *as to same campaign as above(CRO_WW_Purchase~)
>>
>> Kindly let me know any way to solve this discrepancy.
>> Regards,
>> Sejin
>>
>>
>>
>> On Wednesday, June 17, 2020 at 11:34:27 PM UTC+9 adsapiforumadvisor wrote:
>>
>>> Hi Sejin,
>>>
>>> Thank you for reaching out. The picture is again incomplete, could you 
>>> please send the full picture?
>>>
>>>
>>>
>>> Thanks and regards,
>>> Xiaoming, Google Ads API Team
>>>
>>>
>>>
>>>  
>>>
>>> ref:_00D1U1174p._5004Q20YKbf:ref
>>>
>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/e814e027-e668-4132-96a8-86601fa5c905o%40googlegroups.com.


Re: Country Code cannot be retrieved for App Campaign

2020-06-14 Thread sejin jang
Thanks for your reply.

As I posted at the last sentence, my concern is that I cannot retrieve 
right *Id *when campaign is for *World Wide.*
Normally I can see a specific country code of WW campaign google dashboard, 
but cannot see through API call.


On Saturday, June 13, 2020 at 1:18:29 AM UTC+9, adsapiforumadvisor wrote:
>
> Hi Sejin,
>
> Thank you for reaching out. You would be able to query the country code 
> from the Campaign Location Target Report 
> .
>  
> Id 
> 
>  
> field in this report corresponds to the country code.
>
> Thanks and regards,
> Xiaoming, Google Ads API Team
>
>
>  
>
> ref:_00D1U1174p._5004Q20YKbf:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d31dff3e-8253-45af-ad23-7042e2e73364o%40googlegroups.com.