Hi,
get error when try to get data from google ads:
Error: 7 PERMISSION_DENIED: Google Ads API has not been used in project xxxxxxxxxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/googleads.googleapis.com/overview?project=xxxxxxxxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
code:
const {GoogleAdsApi, enums} = require('google-ads-api');
const client = new GoogleAdsApi({
client_id: 'xxxxxxxxxxxx',
client_secret: 'xxxxxxxxxxxx',
developer_token: 'xxxxxxxxxxxx',
})
const customer = client.Customer({
customer_id: '000-000-0000',
refresh_token: 'xxxxxxxxxxxx',
});
const campaigns = await customer.report({
entity: "ad_group",
metrics: [
"metrics.cost_micros",
"metrics.clicks",
"metrics.impressions",
"metrics.all_conversions",
],
segments: ["segments.date"],
from_date: "2021-11-10",
to_date: "2021-11-11",
});
What is wrong ?
How to resolve this issue ?
thanks
|
||||||