Skip to content

credentials must be a ChannelCredentials object #229

@githubid0719

Description

@githubid0719

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,
}]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions