Re: Adding latitudes & longitudes programmatically

2018-11-01 Thread cosbgn
This worked. Thank you Sreelakshmi!

On Tuesday, October 30, 2018 at 7:38:06 PM UTC+2, Sreelakshmi Sasidharan 
(AdWords API Team) wrote:
>
> Hello, 
>
> To add a latitude and longitude to proximity criterion, you would need to 
> set the latitude and longitude in micro degrees. Also, the 
> radiusDistanceUnits and radiusInUnits should be set in the proximity 
> object. Could you please give the below code snippet a  try and let me know 
> if that works? 
>
>   proximity = {
>   'xsi_type': 'Proximity',
>   'geoPoint':{
>   'latitudeInMicroDegrees' : '40712800',
>   'longitudeInMicroDegrees' : '74006000' 
>  },
>   'radiusDistanceUnits': 'KILOMETERS',
>   'radiusInUnits' : '50.0'
>
>   }
>
> Thanks,
> Sreelakshmi, AdWords API Team
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/186e51cd-32ad-4771-a557-7f991e2734c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding latitudes & longitudes programmatically

2018-10-30 Thread 'Sreelakshmi Sasidharan (AdWords API Team)' via AdWords API and Google Ads API Forum
Hello, 

To add a latitude and longitude to proximity criterion, you would need to 
set the latitude and longitude in micro degrees. Also, the 
radiusDistanceUnits and radiusInUnits should be set in the proximity 
object. Could you please give the below code snippet a  try and let me know 
if that works? 

  proximity = {
  'xsi_type': 'Proximity',
  'geoPoint':{
  'latitudeInMicroDegrees' : '40712800',
  'longitudeInMicroDegrees' : '74006000' 
 },
  'radiusDistanceUnits': 'KILOMETERS',
  'radiusInUnits' : '50.0'

  }

Thanks,
Sreelakshmi, AdWords API Team

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a4e8eb76-f9cf-47be-8308-c219b7c42240%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Adding latitudes & longitudes programmatically

2018-10-30 Thread cosbgn
I'm trying to add some lat/lon with python, my code looks like this:

lx = [{"loc":0, "lat":0}]
operations = []

for loc in lx:
criterion = {
 "xsi_type":"Proximity", 
 "geoPoint":{

"latitude_in_micro_degrees":float(loc['lat']),

"longitude_in_micro_degrees":float(loc['lat'])}, 

"radius_distance_units":"KILOMETERS", "radius_in_units":50

}


operations.append({'operator': 'ADD', 'operand': { 'campaignId': ad_id, 
'criterion': criterion} })


operations = operations[:500] # Google Ads Limit
result = campaign_criterion_service.mutate(operations)

However I get the error: `KeyError: 'geoPoint'` What am I doing wrong?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/b6c1360f-3c09-419e-80fe-d48f3ba14e20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.