Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

credentials must be a ChannelCredentials object #1544

Open
githubid0719 opened this issue Jan 19, 2024 · 0 comments
Open

credentials must be a ChannelCredentials object #1544

githubid0719 opened this issue Jan 19, 2024 · 0 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@githubid0719
Copy link

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 githubid0719 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant