Google Ad Manager API: Node.js Client
Google Ad Manager API client for Node.js
A comprehensive list of changes in each version may be found in the CHANGELOG.
- Google Ad Manager API Node.js Client API Reference
- Google Ad Manager API Documentation
- github.com/googleapis/google-cloud-node/packages/google-ads-admanager
Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.
Table of contents:
Quickstart
Before you begin
- Select or create a Cloud Platform project.
- Enable billing for your project.
- Enable the Google Ad Manager API API.
- Set up authentication so you can access the API from your local workstation.
Installing the client library
npm install @google-ads/admanager
Using the client library
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent, which owns this collection of AdUnitSizes.
* Format: `networks/{network_code}`
*/
// const parent = 'abc123'
/**
* Optional. The maximum number of AdUnitSizes to return. The service may
* return fewer than this value. If unspecified, at most 50 ad unit sizes will
* be returned. The maximum value is 1000; values above 1000 will be coerced
* to 1000.
*/
// const pageSize = 1234
/**
* Optional. A page token, received from a previous `ListAdUnitSizes` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListAdUnitSizes` must
* match the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Optional. Expression to filter the response.
* See syntax details at
* https://developers.google.com/ad-manager/api/beta/filters
*/
// const filter = 'abc123'
/**
* Optional. Expression to specify sorting order.
* See syntax details at
* https://developers.google.com/ad-manager/api/beta/filters#order
*/
// const orderBy = 'abc123'
/**
* Optional. Number of individual resources to skip while paginating.
*/
// const skip = 1234
// Imports the Admanager library
const {AdUnitServiceClient} = require('@google-ads/admanager').v1;
// Instantiates a client
const admanagerClient = new AdUnitServiceClient();
async function callListAdUnitSizes() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = admanagerClient.listAdUnitSizesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAdUnitSizes();
Samples
Samples are in the samples/
directory. Each sample's README.md
has instructions for running its sample.
Sample | Source Code | Try it |
---|---|---|
Ad_unit_service.get_ad_unit | source code | |
Ad_unit_service.list_ad_unit_sizes | source code | |
Ad_unit_service.list_ad_units | source code | |
Company_service.get_company | source code | |
Company_service.list_companies | source code | |
Custom_field_service.get_custom_field | source code | |
Custom_field_service.list_custom_fields | source code | |
Custom_targeting_key_service.get_custom_targeting_key | source code | |
Custom_targeting_key_service.list_custom_targeting_keys | source code | |
Custom_targeting_value_service.get_custom_targeting_value | source code | |
Custom_targeting_value_service.list_custom_targeting_values | source code | |
Entity_signals_mapping_service.batch_create_entity_signals_mappings | source code | |
Entity_signals_mapping_service.batch_update_entity_signals_mappings | source code | |
Entity_signals_mapping_service.create_entity_signals_mapping | source code | |
Entity_signals_mapping_service.get_entity_signals_mapping | source code | |
Entity_signals_mapping_service.list_entity_signals_mappings | source code | |
Entity_signals_mapping_service.update_entity_signals_mapping | source code | |
Network_service.get_network | source code | |
Network_service.list_networks | source code | |
Order_service.get_order | source code | |
Order_service.list_orders | source code | |
Placement_service.get_placement | source code | |
Placement_service.list_placements | source code | |
Report_service.create_report | source code | |
Report_service.fetch_report_result_rows | source code | |
Report_service.get_report | source code | |
Report_service.list_reports | source code | |
Report_service.run_report | source code | |
Report_service.update_report | source code | |
Role_service.get_role | source code | |
Role_service.list_roles | source code | |
Taxonomy_category_service.get_taxonomy_category | source code | |
Taxonomy_category_service.list_taxonomy_categories | source code | |
User_service.get_user | source code | |
Quickstart | source code |
The Google Ad Manager API Node.js Client API Reference documentation also contains samples.
Supported Node.js Versions
Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update as soon as possible to an actively supported LTS version.
Google's client libraries support legacy versions of Node.js runtimes on a best-efforts basis with the following warnings:
- Legacy versions are not tested in continuous integration.
- Some security patches and features cannot be backported.
- Dependencies cannot be kept up-to-date.
Client libraries targeting some end-of-life versions of Node.js are available, and
can be installed through npm dist-tags.
The dist-tags follow the naming convention legacy-(version)
.
For example, npm install @google-ads/admanager@legacy-8
installs client libraries
for versions compatible with Node.js 8.
Versioning
This library follows Semantic Versioning.
This library is considered to be in preview. This means it is still a work-in-progress and under active development. Any release is subject to backwards-incompatible changes at any time.
More Information: Google Cloud Platform Launch Stages
Contributing
Contributions welcome! See the Contributing Guide.
Please note that this README.md
, the samples/README.md
,
and a variety of configuration files in this repository (including .nycrc
and tsconfig.json
)
are generated from a central template. To edit one of these files, make an edit
to its templates in
directory.
License
Apache Version 2.0
See LICENSE