Hey,
I am looking to retrieve the following campaign data using a script:
Campaign ID
Campaign Name
Auction Domain
Auction Impression Share
The following is the code in use:
function main() {
var query = `
SELECT
campaign.id,
campaign.name,
segments.auction_insight_domain,
metrics.auction_insight_search_impression_share
FROM campaign
WHERE segments.date = '2022-06-10'
AND campaign.advertising_channel_type = 'SEARCH'
AND campaign.status = 'ENABLED'
ORDER BY
campaign.id ASC
`;
var report = AdsApp.report(query);
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();
Logger.log(row);
}
I have verified the script using the query validator:
https://developers.google.com/google-ads/api/fields/v11/query_validatorUnfortunately when we run the script we are getting the following error (using the New Script Experience):
15/06/2022 09:51:20 Exception: Call to GoogleAdsService.Search failed: Unrecognized fields in the query: 'segments.auction_insight_domain', 'metrics.auction_insight_search_impression_share'.
at adsapp_compiled:18068:138
at adsapp_compiled:18079:9
at ra (adsapp_compiled:227:15)
at Object.search (adsapp_compiled:235:20)
at bI.search (adsapp_compiled:18194:36)
at LH.search (adsapp_compiled:17771:19)
at MH.search (adsapp_compiled:17866:20)
at TH.search (adsapp_compiled:17958:19)
at ed (adsapp_compiled:1042:15)
at ed.next (<anonymous>)
Can you please help me get the auction insights metrics?
Thanks,