google-ads-api
google-ads-api copied to clipboard
Query returns campaign data, but report options does not based on TODAY date_constant
The below query returns all the campaigns perfectly fine.
SELECT
campaign.id,
campaign.name,
campaign.status,
campaign.bidding_strategy_type,
campaign.advertising_channel_type,
campaign.start_date,
campaign.end_date,
campaign_budget.amount_micros,
metrics.cost_micros,
metrics.clicks,
metrics.impressions,
metrics.conversions
FROM
campaign
WHERE
segments.date DURING TODAY
While trying to fetch with the methods and config I get empty array returned.
const campaigns = await customer.report({
entity: "campaign",
attributes: [
"campaign.id",
"campaign.name",
"campaign.status",
"campaign.bidding_strategy_type",
"campaign.advertising_channel_type",
"campaign.start_date",
"campaign.end_date",
"campaign_budget.amount_micros",
],
metrics: [
"metrics.cost_micros",
"metrics.clicks",
"metrics.impressions",
"metrics.conversions",
],
segments: ["segments.date"],
date_constant: "TODAY",
});