How to get the correct query in the campaign location target report

54 views
Skip to first unread message

xmarcle

unread,
Feb 23, 2022, 7:15:08 AM2/23/22
to Google Ads API and AdWords API Forum
Hi,
  According to the query result of Adwords API to Google ads API field mapping introduced by campaign location target, I failed.

Method Name: /google.ads.googleads.v9.services.GoogleAdsService/SearchStream
Host: googleads.googleapis.com
Headers: {
"x-goog-api-client": "gl-php\/7.4.5 gccl\/12.1.0 gapic\/12.1.0 gax\/1.10.0 grpc\/1.43.0 rest\/1.10.0",
"x-goog-request-params": "customer_id=1138498986",
"developer-token": "REDACTED",
"login-customer-id": "7505653768"
}
Request:
{"customerId":"1138498986","query":"SELECT segments.date, campaign_criterion.criterion_id, campaign.name, campaign_criterion.bid_modifier, metrics.clicks, metrics.impressions, metrics.interaction_rate, metrics.average_cpc, metrics.cost_micros, metrics.conversions, metrics.conversions_from_interactions_rate, metrics.cost_per_conversion, campaign_criterion.negative FROM keyword_view WHERE segments.date >= '20220214' AND segments.date <= '20220222' "}

Response
-------
Headers: {
"request-id": "J8TkECUCo824Sf-1IpYVWw",
"date": "Wed, 23 Feb 2022 12:10:53 GMT",
"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
}

Fault
-------
Status code: 3
Details: Request contains an invalid argument.
Failure: {"errors":[{"errorCode":{"queryError":"PROHIBITED_RESOURCE_TYPE_IN_SELECT_CLAUSE"},"message":"Cannot select fields from the following resource: 'CAMPAIGN_CRITERION', since the resource is incompatible with the resource in FROM clause."}],"requestId":"J8TkECUCo824Sf-1IpYVWw"}  

How can I modify it?
thanks.

Google Ads API Forum Advisor

unread,
Feb 23, 2022, 4:00:06 PM2/23/22
to xmarc...@gmail.com, adwor...@googlegroups.com

Hello xmarcle,

Thanks for reaching out to the Google Ads API support team. With regards to your query on how to get the correct query in the campaign location target report.
With this you may use the user location view resource/report. Because the user location data shows only your customer’s physical locations, regardless of any locations they may be interested in. It includes all metrics aggregated at the country level, one row per country. It reports metrics at the actual physical location of the user by targeted or not targeted location. If other segment fields are used, you may get more than one row per country.

Hope this helps, please let me know if you have any questions.

Best regards,

Google Logo
Jakeia Sabrina
Google Ads API Team

 



ref:_00D1U1174p._5004Q2WyJZc:ref
Reply all
Reply to author
Forward
0 new messages