LocationCriterionService returns incorrect values for "CanonicalName" field

69 views
Skip to first unread message

Dzmitry Zahusta

unread,
Jul 28, 2014, 4:54:31 AM7/28/14
to adwor...@googlegroups.com
Hi!

I'm trying to get location names using the following code:

        Selector selector = new SelectorBuilder()
       
.fields(
           
"Id",
           
"LocationName",
           
"DisplayType",
           
"CanonicalName",
           
"TargetingStatus")
       
.in("LocationName", locationName)

       
.equals("Locale", "en")

       
.build();


       
// Make the get request.
       
LocationCriterion[] locationCriteria = locationCriterionService.get(selector);

And comparing results that I get in "CanonicalName" field - it's absolutely different from that I get using https://developers.google.com/adwords/api/docs/appendix/geotargeting page.

Factually "CanonicalName" that I got in runtime is equal to locationName while on web page it looks like this (for Paris):

Paris,Ontario,Canada
Paris,Paris,Ile-de-France,France
Paris,Arkansas,United States
Paris,Idaho,United States
Paris,Illinois,United States
New Paris,Indiana,United States
Paris,Kentucky,United States
Paris,Maine,United States
South Paris,Maine,United State

And for the runtime request:
            <rval>
                <location>
                    <id>1018992</id>
                    <Criterion.Type>Location</Criterion.Type>
                    <locationName>Paris</locationName>
                    <displayType>City</displayType>
                    <targetingStatus>ACTIVE</targetingStatus>
                     .....
                </location>
                <canonicalName>Paris</canonicalName>
                <reach>13000</reach>
                <locale>en</locale>
                <searchTerm>Paris</searchTerm>
            </rval>

What is wrong with LocationCriterionService? Why it returns incorrect values for canonicalName?

Josh Radcliff (AdWords API Team)

unread,
Jul 28, 2014, 1:02:01 PM7/28/14
to adwor...@googlegroups.com
Hi,

I'm looking into this and will post an update as soon as I have more information.

Thanks,
Josh, AdWords API Team

Josh Radcliff (AdWords API Team)

unread,
Dec 8, 2014, 2:56:52 PM12/8/14
to adwor...@googlegroups.com
Hi,

We've identified the source of the inconsistency and will look into fixing the LocationCriterionService in a future version so that it returns unique canonical names. We won't be changing the behavior in released versions (v201406 and v201409) since that would be a behavior change that could break users.

In the meantime, you can use the CSV file if you want to look up by unique canonicalName. The IDs returned will be valid for use in creating Location criteria, even though the canonical names won't match those returned by LocationCriterionService.

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