Registry / gcp / google-ads-node

google-ads-node

JSON →
library23.0.0jsnpmunverified

A low-level Google Ads API client library for Node.js, generated from the experimental Bazel build files. This package is the compiled output of protobuf definitions and requires manual setup, no user-facing documentation is provided. The current version (23.0.0) corresponds to Google Ads API v23. The package is maintained by Opteo but is not recommended for direct use; instead, use the higher-level wrapper google-ads-api. Releases are tied to Google Ads API versions. Key differentiator: it provides raw gRPC stubs for advanced users who need custom control.

npm install google-ads-node
INSTALL
IMPORT
SIG · GOOGLE-ADS-NODE
G
google-ads-node
gcpjavascriptv23.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GoogleAdsClient
import { GoogleAdsClient } from 'google-ads-node'
const GoogleAdsClient = require('google-ads-node').GoogleAdsClient
The package provides named exports; default export is not available. The require pattern works but is not the recommended ES module style.
services
import { services } from 'google-ads-node'
const { services } = require('google-ads-node')
The services object contains all gRPC service stubs like CampaignService, AdGroupService, etc. Both import and require work.
types
import { types } from 'google-ads-node'
The types object provides protobuf message types used in requests/responses. This is a named export.
enums
import { enums } from 'google-ads-node'
const { enums } = require('google-ads-node').enums
Enums are exported as a nested object. Common mistake: trying to destructure enums incorrectly.

Shows how to create a GoogleAdsClient, instantiate a service stub, and run a GAQL query using the GoogleAdsService.

import { GoogleAdsClient, services, enums } from 'google-ads-node'; async function main() { const client = new GoogleAdsClient({ developerToken: process.env.DEVELOPER_TOKEN ?? '', clientId: process.env.CLIENT_ID ?? '', clientSecret: process.env.CLIENT_SECRET ?? '', refreshToken: process.env.REFRESH_TOKEN ?? '', }); const customerId = '1234567890'; const campaignService = new services.GoogleAdsServiceClient(client); const request = { customerId: customerId, query: `SELECT campaign.id, campaign.name FROM campaign WHERE campaign.status = 'PAUSED'`, }; try { const response = await campaignService.search(request); console.log(JSON.stringify(response, null, 2)); } catch (err) { console.error(err.errors); } } main();
Debug
Known issues
gotchaThis library is the raw compiled output of experimental build files; it has no user-friendly documentation and requires manual protobuf handling.
fix
Use the high-level library google-ads-api instead if you want a documented, easy-to-use client.
affects: >=0.1.0
breakingMajor version updates correspond to Google Ads API major versions; breaking changes occur in service APIs, types, and enums.
fix
Refer to Google Ads API release notes and the package's changelog for migration steps between major versions.
affects: >=23.0.0
deprecatedSome service methods or types may be marked as deprecated in Google Ads API v23; use the latest version to avoid broken functionality.
fix
Check the Google Ads API deprecation schedule and update your code to use the recommended alternatives.
affects: >=23.0.0
gotchaThe package is ESM via TypeScript compilation but the published npm package may include CommonJS files. Import resolution can be tricky.
fix
Ensure your project uses Node ESM (type: module in package.json) or use require if sticking to CommonJS.
affects: >=23.0.0
Errors
Common errors & fixes
Cannot find module 'google-ads-node'
Package not installed or import path incorrect.
fix
Run `npm install google-ads-node` and ensure the import uses the full package name.
TypeError: GoogleAdsClient is not a constructor
Default import used but the package only exports named exports.
fix
Change import to `import { GoogleAdsClient } from 'google-ads-node'`.
Error: AuthenticationError.GOOGLE_ACOUNT_NOT_FOUND
Missing or invalid developer token or OAuth credentials.
fix
Verify that your developer token and OAuth2 credentials are correct and set in environment variables.
Error: Request is missing required field customer_id
The request object does not include `customerId` in the correct format (usually string of 10 digits).
fix
Add `customerId: '1234567890'` (without dashes) to the request.
Error: Invalid version: V23 is not a valid version
Attempting to use an API version that is not supported by the library.
fix
Use the version that matches the library version (e.g., v23 for google-ads-node@23.0.0).
Upgrade
Version history
23.0.0latest on npm
Audit
Dependencies
google-gaxrequiredGoogle API client runtime used for connection handling, auth, and gRPC setup.
Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
1
Resources
google-ads-node — npm install google-ads-node · libregistry