Creating campaign location targeting

57 views
Skip to first unread message

ad...@armis.tech

unread,
Jan 24, 2017, 12:08:42 PM1/24/17
to AdWords API Forum
Hi !

I'd like to add a location targeting to my campaign using the API. I've spent some time looking on the forum and the documentation but I can't find a way to do it in python.
I've tried something like that but obviously that did not work.

{'xsi_type': 'Proximity', 'address': tup[0], 'radiusMeters':'1000',}
The error I had: Server raised fault: 'Unmarshalling Error: cvc-complex-type.2.3: Element 'ns0:criterion' cannot have character [children]

I read that it is possible to use the address, so is there a specific format ?  And can I specify more than one radius or should I create a new targeting ?

Thank you in advance.

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Jan 24, 2017, 3:10:53 PM1/24/17
to AdWords API Forum
Hi, 

It is possible to use the address in the proximity criterion. Please check our documentation about the Location targeting for better clarity. For a given proximity, you can have only one radius. If you would like to set more than one radius you will need to create new targeting for each of them.

We don't have a sample using the proximity criterion in the targeting, but you could refer to this sample which sets other types of targeting. As mentioned in the guide for location targeting, you could use the address and proximity instead.

A sample structure should be as given below:

'xsi_type': 'Proximity',
'address': {
'streetAddress': '110 8th ave',
'cityName': 'New York',
'postalCode': '10011',
'countryCode': 'US'
},
'radiusDistanceUnits': 'KILOMETERS',
'radiusInUnits': 10


Thanks,
Sreelakshmi, AdWords API Team
Reply all
Reply to author
Forward
0 new messages