Updating from v201502 to v201509 ( LocationExtensionOperand )

117 views
Skip to first unread message

ph...@socialr.nl

unread,
Nov 18, 2015, 1:28:12 PM11/18/15
to AdWords API Forum
Hi!

I recently updated to from v201502 to v201509.
After upgrading the API stopped working because of the required feedId (RequiredError.REQUIRED @ operations[2].operand.criterion.feedId).
If I understand correctly it is now required to provide a feedId if you use the LocationExtensionOperand. (http://googleadsdeveloper.blogspot.nl/2015/07/feedmappings-for-location-targeting.html)

We use AdWords to place ads for clients anywhere around the world and currently target locations with a 20 mile radius.

If you take a look at the example code:

How would we target using LocationExtensionOperand without needing to provide additional locations via FeedMapping?

Thanks!

Nadine Sundquist (AdWords API Team)

unread,
Nov 19, 2015, 9:51:10 AM11/19/15
to AdWords API Forum
Hello,

Nice job on finding the blog post! Yes, your understanding is correct that you now need a feed ID when you have a LocationExtensionOperand in your matching function.

To solve your issue, here are two possible solutions:
  • Option 1: It sounds like you may already have a Feed with your target location defined. What you would need to do is to do a get() to get that feed ID with the location and then explicitly set it on the criterion.
  • Option 2: This is a completely different approach that may work for you. You could give Proximity Targeting a try. It also gives you the ability to provide a radius around a target location criterion ID.
Cheers,
Nadine, AdWords API Team  

ph...@socialr.nl

unread,
Nov 19, 2015, 11:39:40 AM11/19/15
to AdWords API Forum
Hi Nadine,

Thanks for your reply.
Do you have an code example (in PHP if possible) on how to use the Proximity Targeting with a target location criterion ID instead of an address?

Thanks!

Kind regards,
Philo

Op donderdag 19 november 2015 15:51:10 UTC+1 schreef Nadine Sundquist (AdWords API Team):

Nadine Sundquist (AdWords API Team)

unread,
Nov 19, 2015, 3:27:00 PM11/19/15
to AdWords API Forum
Hi Philo,

I don't have an exact example, but I have one that is very close. Look at the AddCampaignTargetCriteria PHP example, and replace Location with Proximity. You'll find details about the Proximity object here

Best,
Nadine, AdWords API Team

ph...@socialr.nl

unread,
Nov 19, 2015, 3:40:06 PM11/19/15
to AdWords API Forum
Hi Nadine,

Thanks! I was able to get this working by entering the location name and country in the address field.

$proximity = new \Proximity();
$proximity->radiusDistanceUnits = 'MILES';
$proximity->radiusInUnits = 20;
$proximity->address = new \Address(null, null, $loc->name, null, null, null, $loc->country);
$campaignCriteria[] = new CampaignCriterion('<id>', null, $proximity);

I would prefer to use the location criterion ID, but I'm not able to find any documentation on how to pass this ID to the proximity. The only options are geoPoint or address. ( https://developers.google.com/adwords/api/docs/reference/v201509/CampaignCriterionService.Proximity )
Is this correct or is there a different way?

Thanks

Op donderdag 19 november 2015 21:27:00 UTC+1 schreef Nadine Sundquist (AdWords API Team):

Nadine Sundquist (AdWords API Team)

unread,
Nov 19, 2015, 4:40:37 PM11/19/15
to AdWords API Forum
Hello Philo,

I'm pleased to hear that you got it working! I'm not sure on how to do that, either. If I find something, I'll post it here.

Regards,
Nadine, AdWords API Team

ph...@socialr.nl

unread,
Nov 26, 2015, 9:33:47 AM11/26/15
to AdWords API Forum
Hi Nadine,

I've discovered that it's not working correctly in production.

Example:

The 20 mile radius is not applied, it states "20.0 mi around each location extension" (not visible on the map).

While this is the result in the sandbox environment:

Seems to be a bug, since the code is exactly the same.

Could you let me know how to continue?

Thanks!

Op donderdag 19 november 2015 22:40:37 UTC+1 schreef Nadine Sundquist (AdWords API Team):

Nadine Sundquist (AdWords API Team)

unread,
Nov 30, 2015, 10:56:11 AM11/30/15
to AdWords API Forum
Hello Philo,

Are you saying that you created one in a test account and one in a production account, or are you saying that you created one through the API and one manually? Were they both created through a test account?

Best,
Nadine, AdWords API Team

ph...@socialr.nl

unread,
Nov 30, 2015, 12:12:59 PM11/30/15
to AdWords API Forum
Hi Nadine,

Both were created through the API.
One using a test a test account (sandbox) which worked.
When using the exact same code and settings in production it didn't work (see previous screenshots).

Kind regards,
Philo

Op maandag 30 november 2015 16:56:11 UTC+1 schreef Nadine Sundquist (AdWords API Team):

Nadine Sundquist (AdWords API Team)

unread,
Nov 30, 2015, 5:58:03 PM11/30/15
to AdWords API Forum
Hi Philo,

Thanks for the clarification. That is strange. I'm working on trying to reproduce it from my end, so I can find a solution. I'll get back to you as soon as I have it figured out.

Best,
Nadine, AdWords API Team

Nadine Sundquist (AdWords API Team)

unread,
Dec 1, 2015, 10:59:36 AM12/1/15
to AdWords API Forum
Hello Philo,

I gave this a try on both my production account and my test account with the same code. Unfortunately, I'm unable to reproduce what you're seeing. Here's an example of the SOAP XML mutate that I sent out.

<mutate xmlns="https://adwords.google.com/api/adwords/cm/v201509"><operations><operator>ADD</operator><operand><campaignId>241400475</campaignId><criterion xsi:type="Proximity" ><radiusDistanceUnits>MILES</radiusDistanceUnits><radiusInUnits>20</radiusInUnits><address><cityName>Tiel</cityName><provinceName>Gelderland</provinceName><countryCode>NL</countryCode></address></criterion></operand></operations></mutate>

I then looked at the AdWords user interface, and I ended up with the same result in the user interface for both my production and test accounts.


Could you please verify that your SOAP XML request looks exactly the same for the two requests and that it looks similar to what I've sent? If they are exactly the same and you're still experiencing issues, please choose Reply privately to author from the drop-down when replying and include the SOAP XML request.


Thanks,

Nadine, AdWords API Team

Reply all
Reply to author
Forward
0 new messages