I'm attempting to recreate the basic functionality in the Campaign >
Locations section, specifically with specifying a radius. After some
digging it looks like I should be using the Proximity Criteria Type in the
CampaignCriterionService, but when I retrieve the list from the criteria,
the Address block is mostly empty. All that I receive is provinceName. My
current campaign settings specify a radius of x-Miles for a specific zip
code. I'd expect to see postalCode returned with the provinceName.
Here's a snippet for my C# implementation:
var campaignService = (CampaignCriterionService)request.AdWordsUser.
GetService(AdWordsService.v201705.CampaignCriterionService);
var campaignLocationPage = campaignService.get(new Selector
{
fields = new string[]
{
Criterion.SelectableFields.Id,
Criterion.SelectableFields.CriteriaType,
Proximity.SelectableFields.Address,
Proximity.SelectableFields.GeoPoint,
Proximity.SelectableFields.RadiusDistanceUnits,
Proximity.SelectableFields.RadiusInUnits
},
predicates = new Predicate[]
{
new Predicate
{
field = Criterion.FilterableFields.CriteriaType,
@operator = PredicateOperator.EQUALS,
values = new string[] { CriterionType.PROXIMITY.ToString() }
},
new Predicate
{
field = "CampaignId",
@operator = PredicateOperator.IN,
values = request.CampaignIdList.Select(x => x.ToString()).
ToArray() // This is just a list of campaign IDs converted into an array of
strings
}
}
});
I've found other posts where this type of query settings are recommended,
but they don't show full code snippets, or address the issue of an empty
Address.
I've gone so far as to try to hard-code the names of the Address fields in
my Selector's fields, (ex: "PostalCode" or "POSTALCODE") and received an
error back from the API, stating that the field name is invalid.
Thank you in advance. Any help would be greatly appreciated!
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
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/c67a78ca-f26a-4f93-ba25-1ce1b40378aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.