gax-nodejs icon indicating copy to clipboard operation
gax-nodejs copied to clipboard

credentials must be a ChannelCredentials object

Open githubid0719 opened this issue 2 years ago • 0 comments

An error occurred while executing the 'customer.conversionActions.create' method. 'Channel credentials must be a ChannelCredentials object', The configuration information of my 'googleClientConfiguration' can be executed successfully in the Python version of SDK. Did I write it? Is there any problem?

import { GoogleAdsApi, services, enums } from 'google-ads-api';

function getCustomer(googleClientConfig: any, customerId: string): Customer { const { client_id: clientId, client_secret: clientSecret, developer_token: developerToken, refresh_token: refreshToken, login_customer_id: loginCustomerId, } = googleClientConfig; const client = new GoogleAdsApi({ client_id: clientId, client_secret: clientSecret, developer_token: developerToken, }); const customer = client.Customer({ customer_id: customerId, refresh_token: refreshToken, login_customer_id: loginCustomerId, }); return customer; }

const customerId = 'xxxxxxxx'; const googleClientConfig = { client_id: 'xxxx', client_secret: 'xxxxx', developer_token: 'xxxx', refresh_token: 'xxxx', login_customer_id: 'xxxxx' };

const customer = getCustomer(googleClientConfig, customerId); res = await customer.conversionActions.create([{ name: ’xxxxxxx‘, status: enums.ConversionActionStatus.ENABLED, click_through_lookback_window_days: 90, type: enums.ConversionActionType.UPLOAD_CLICKS, category: enums.ConversionActionCategory.DEFAULT, }]);

githubid0719 avatar Jan 19 '24 11:01 githubid0719