RE: LocationView Service returns empty LocationInfo

65 views
Skip to first unread message
Message has been deleted

Google Ads API Forum Advisor Prod

unread,
Aug 10, 2020, 3:46:46 PM8/10/20
to adwor...@googlegroups.com
Hi,

Thank you for reaching out to us. I see that you're experiencing an issue where you're receiving empty location campaign criteria. Could you provide us with a request and response log for where you encounter this discrepancy so that I can further investigate? You can reply privately using "reply privately to author".

Thank you,
Bryan, Google Ads API Team

ref:_00D1U1174p._5004Q23IuF2:ref

tetiana....@partners.2sixty.io

unread,
Aug 11, 2020, 3:40:08 AM8/11/20
to AdWords API and Google Ads API Forum
HI, Bryan,
Screenshots with method body, request and response are in the first letter. If you have some additional questions, feel free to ask.

BG,
Tetiana

Google Ads API Forum Advisor Prod

unread,
Aug 11, 2020, 2:16:42 PM8/11/20
to adwor...@googlegroups.com
Hi Tetiana,

Thank you for the update. I did see the screenshots with your code snippet and your error message, however, in order for me to investigate why your call seems to work fine in almost all cases except for this one, I'll need the full request and response log that details the exact request and the full response of the error that you're encountering. You can see how to enable logs here. Could I ask you for these logs so that I can further investigate this concern?

tetiana....@partners.2sixty.io

unread,
Aug 12, 2020, 4:19:24 AM8/12/20
to AdWords API and Google Ads API Forum

Hi, Bryan,
Or request query looks like this:

SELECT

campaign_criterion.location.geo_target_constant,

campaign_criterion.negative

FROM

location_view

WHERE

campaign.id = 1378332378

AND campaign_criterion.negative = FALSE 

I can not send you logs with the error because I don't receive any error, the point is that response is successful BUT it is empty. That's why I sent you this screenshot to show how response looks in pdb mode:

Screen Shot 2020-08-10 at 12.10.15 PM.png

As you can see I receive campaign criterions (their amount is equal to amount of countries which are targeting on UI) of location type. BUT when I'm getting location from campaign_criterion it is empty although it must contain geo_target_constant string value, here this string value is empty. That is the issue, no obvious error occurs here.


BG,

Tetiana

Google Ads API Forum Advisor Prod

unread,
Aug 12, 2020, 3:16:15 PM8/12/20
to adwor...@googlegroups.com
Hi Tatiana,

I'll take a closer look at this with my team and get back to you as soon as possible.

cv

unread,
Aug 13, 2020, 6:43:55 AM8/13/20
to AdWords API and Google Ads API Forum
I am also getting same.
When I tried to fetch Location and Language through campaign_criterion view.

When I try to access like this, Does I cannot get campaign_criterion.location.geo_target_constant using campaign_criterion view?
If this is the case how I can identify what view need to be use to get those data?
There must be simpler API explanation which view I need to use?

I am using like this
$googleAdsRow->getCampaignCriterion()->getLocation()->getGeoTargetConstantUnwrapped() 
$googleAdsRow->getCampaignCriterion()->getLanguage()->getLanguageConstantUnwrapped()

Getting error

Call to a member function getLanguageConstant() on null

Thanks

Google Ads API Forum Advisor Prod

unread,
Aug 17, 2020, 4:05:40 PM8/17/20
to chirag....@gmail.com, adwor...@googlegroups.com
Hi Tetiana, cv,

I'll file a request with the teams to investigate further. From an initial glance, I do not see anything wrong with your request.

As a workaroud, you can parse and lookup this information yourself as follows:

1. Split the resource name by the ~ sign. The criterion ID is the second half (e.g. 20321 from Tetiana's screenshot).
2. Make a call to LanguageConstantService to retrieve the language details. Call GeoTargetConstantService for location details.
3. Optionally, you can look up the values from the csvs linked at https://developers.google.com/adwords/api/docs/appendix/codes-formats#languages and https://developers.google.com/adwords/api/docs/appendix/geotargeting respectively. E.g. if you lookup the second CSV, 20321  corresponds to "Ile-de-France,France", which can be confirmed on the UI under campaign settings for the campaign ID you posted.

Cheers
Anash

ref:_00D1U1174p._5004Q23IuF2:ref

tetiana....@partners.2sixty.io

unread,
Aug 18, 2020, 8:31:48 AM8/18/20
to AdWords API and Google Ads API Forum
Hi Anash,
I just rerun this request for the same account/campaign, here are examples how correct response looks and how incorrect response looks:
Correct:
Screen Shot 2020-08-18 at 3.25.21 PM.png
Incorrect:
Screen Shot 2020-08-18 at 3.25.31 PM.png
As you can see correct campaign criteria contains location inside it.

But since criterion_id looks the same as geo_target_constant_id we can use your workaround and extract it from campaign_criterion resource name.
Screen Shot 2020-08-18 at 3.25.21 PM.png
Thanks,
Tetiana
Reply all
Reply to author
Forward
0 new messages