Hi,
Thank you for reaching out to the Google Ads API support team.
Please be informed that I have removed your response from the forums as it contains the PII information.
By reviewing your concern, I understand that there is a discrepancy in data between the Google Ads User Interface (UI) and the Google Ads API. Kindly note that the Google Ads API mirrors the Google Ads UI. The reason you are not receiving any response is that in your GAQL query, you are attempting to fetch data from the "
ad_group_ad" resource, while the data you are seeking is typically found in the campaigns tab as indicated by the screenshot you provided.
I would suggest you please execute the following query, which will retrieve impressions and clicks data from the
campaign resource:
- SELECT campaign.id, campaign.name, metrics.clicks, metrics.conversions, metrics.cost_micros FROM campaign WHERE segments.date BETWEEN '2023-09-01' AND '2023-09-30'
Kindly get back to us if you have any further questions related to the Google Ads API.
Please find your message with redacted information:
The google ads API is not getting data for some date ranges but the dashboard is showing the spend data. One of the date range we tried is 2023-09-01 to 2023-09-30 which return []
Request:
const url = "
https://googleads.googleapis.com/v13/customers/XXXXXXXXXX/googleAds:searchStream";
const method = "post";
const token = "xxxxxxxxxxx"
const headers = {
"Authorization" : "Bearer " + token,
"developer-token" : "xxxxxxxxxxxxx",
"login-customer-id" : "XXXXXXXXXX",
"Content-Type" : "application/json"
}
const query = "SELECT segments.date,customer.descriptive_name,
campaign.name,
ad_group.name,ad_group_ad.
ad.name,metrics.cost_micros,metrics.conversions,metrics.conversions_value,metrics.impressions,metrics.clicks FROM ad_group_ad WHERE segments.date BETWEEN '2023-09-01' AND '2023-09-30'"
const data = {
"query" : query
}
axios({
method: method,
url: url,
headers : headers,
data: data
}).then(function(res) {
console.log(res.data)
console.log(res.status)
console.log(res.headers)
}).catch(function(err) {
console.log(err)
})
LOGS:
Response : []
Response headers: {
'request-id': 'XXXXXXXXXXXXXXXX',
'content-type': 'application/json; charset=UTF-8',
vary: 'X-Origin, Referer, Origin,Accept-Encoding',
date: 'Fri, 13 Oct 2023 07:43:47 GMT',
server: 'ESF',
'cache-control': 'private',
'x-xss-protection': '0',
'x-frame-options': 'SAMEORIGIN',
'x-content-type-options': 'nosniff',
'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
'accept-ranges': 'none',
connection: 'close',
'transfer-encoding': 'chunked'
}
SCREENSHOT from Google ads dashboard for same date range: (attached)
Please help us resolve this issue.?
This message is in relation to case "ref:!00D1U01174p.!5004Q02pRLb7:ref"
Thanks,
 |
Google Ads API Team |
