Utility library and code samples for working with the Data Manager API and Node.js.
- Node.js 22+
The @google-ads/datamanager-util utility library is published to
npm. Install it
using npm:
npm install @google-ads/datamanager-utilFor complete instructions on setting up API access and installing the client and utility libraries, see the Set up API access and Install a client library guides.
-
util: Source code and tests for the@google-ads/datamanager-utilnpm package. Use the utilities in the library to help with common tasks like formatting, hashing, and encoding data for Data Manager API requests. -
samples: Code samples demonstrating how to construct and send requests to the Data Manager API using the@google-ads/datamanagerclient library and the@google-ads/datamanager-utilutility library.
To run a sample, invoke the script using the command line. You can pass arguments to the script in one of two ways:
npm run ingest-events -w samples \
--operating_account_type=<operating_account_type> \
--operating_account_id=<operating_account_id> \
--conversion_action_id=<conversion_action_id> \
--json_file='</path/to/your/file>'You can also save arguments in a file.
Note: The arguments filename must end in .json.
{
"operating_account_type": "YOUR_OPERATING_ACCOUNT_TYPE",
"operating_account_id": "YOUR_OPERATING_ACCOUNT_ID",
"conversion_action_id": "YOUR_CONVERSION_ACTION_ID",
"json_file": "samples/sampledata/events_1.json"
}
Then, run the sample with the --config argument:
npm run ingest-events -w samples --config /path/to/your/argsjsonfileContributions welcome! See the Contributing Guide.