Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@google-analytics/admin

Package Overview
Dependencies
Maintainers
0
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-analytics/admin

Admin client for Node.js

  • 7.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5K
decreased by-19.98%
Maintainers
0
Weekly downloads
 
Created
Source

Google Cloud Platform logo

Google Analytics Admin: Node.js Client

release level npm version

Admin client for Node.js

A comprehensive list of changes in each version may be found in the CHANGELOG.

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

  1. Select or create a Cloud Platform project.
  2. Enable the Google Analytics Admin API.
  3. Set up authentication with a service account so you can access the API from your local workstation.

Installing the client library

npm install @google-analytics/admin

Using the client library

// Imports the Google Analytics Admin API client library
const analyticsAdmin = require('@google-analytics/admin');

async function main() {
  // Instantiates a client using default credentials.
  // TODO(developer): uncomment and use the following line in order to
  //  manually set the path to the service account JSON file instead of
  //  using the value from the GOOGLE_APPLICATION_CREDENTIALS environment
  //  variable.
  // const analyticsAdminClient = new analyticsAdmin.AnalyticsAdminServiceClient(
  //     {keyFilename: "your_key_json_file_path"});
  const analyticsAdminClient = new analyticsAdmin.AnalyticsAdminServiceClient();

  // Calls listAccounts() method of the Google Analytics Admin API and prints
  // the response for each account.
  const [accounts] = await analyticsAdminClient.listAccounts();

  console.log('Accounts:');
  accounts.forEach(account => {
    console.log(account);
  });
}

main(...process.argv.slice(2)).catch(err => {
  console.error(err.message);
  process.exitCode = 1;
});
process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});


Samples

Samples are in the samples/ directory. Each sample's README.md has instructions for running its sample.

SampleSource CodeTry it
Analytics_admin_service.acknowledge_user_data_collectionsource codeOpen in Cloud Shell
Analytics_admin_service.approve_display_video360_advertiser_link_proposalsource codeOpen in Cloud Shell
Analytics_admin_service.archive_audiencesource codeOpen in Cloud Shell
Analytics_admin_service.archive_custom_dimensionsource codeOpen in Cloud Shell
Analytics_admin_service.archive_custom_metricsource codeOpen in Cloud Shell
Analytics_admin_service.audit_user_linkssource codeOpen in Cloud Shell
Analytics_admin_service.batch_create_access_bindingssource codeOpen in Cloud Shell
Analytics_admin_service.batch_create_user_linkssource codeOpen in Cloud Shell
Analytics_admin_service.batch_delete_access_bindingssource codeOpen in Cloud Shell
Analytics_admin_service.batch_delete_user_linkssource codeOpen in Cloud Shell
Analytics_admin_service.batch_get_access_bindingssource codeOpen in Cloud Shell
Analytics_admin_service.batch_get_user_linkssource codeOpen in Cloud Shell
Analytics_admin_service.batch_update_access_bindingssource codeOpen in Cloud Shell
Analytics_admin_service.batch_update_user_linkssource codeOpen in Cloud Shell
Analytics_admin_service.cancel_display_video360_advertiser_link_proposalsource codeOpen in Cloud Shell
Analytics_admin_service.create_access_bindingsource codeOpen in Cloud Shell
Analytics_admin_service.create_ad_sense_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_audiencesource codeOpen in Cloud Shell
Analytics_admin_service.create_big_query_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_calculated_metricsource codeOpen in Cloud Shell
Analytics_admin_service.create_channel_groupsource codeOpen in Cloud Shell
Analytics_admin_service.create_connected_site_tagsource codeOpen in Cloud Shell
Analytics_admin_service.create_conversion_eventsource codeOpen in Cloud Shell
Analytics_admin_service.create_custom_dimensionsource codeOpen in Cloud Shell
Analytics_admin_service.create_custom_metricsource codeOpen in Cloud Shell
Analytics_admin_service.create_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.create_display_video360_advertiser_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_display_video360_advertiser_link_proposalsource codeOpen in Cloud Shell
Analytics_admin_service.create_event_create_rulesource codeOpen in Cloud Shell
Analytics_admin_service.create_event_edit_rulesource codeOpen in Cloud Shell
Analytics_admin_service.create_expanded_data_setsource codeOpen in Cloud Shell
Analytics_admin_service.create_firebase_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_google_ads_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_key_eventsource codeOpen in Cloud Shell
Analytics_admin_service.create_measurement_protocol_secretsource codeOpen in Cloud Shell
Analytics_admin_service.create_propertysource codeOpen in Cloud Shell
Analytics_admin_service.create_rollup_propertysource codeOpen in Cloud Shell
Analytics_admin_service.create_rollup_property_source_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_s_k_ad_network_conversion_value_schemasource codeOpen in Cloud Shell
Analytics_admin_service.create_search_ads360_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_subpropertysource codeOpen in Cloud Shell
Analytics_admin_service.create_subproperty_event_filtersource codeOpen in Cloud Shell
Analytics_admin_service.create_user_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_web_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.delete_access_bindingsource codeOpen in Cloud Shell
Analytics_admin_service.delete_accountsource codeOpen in Cloud Shell
Analytics_admin_service.delete_ad_sense_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_android_app_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.delete_big_query_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_calculated_metricsource codeOpen in Cloud Shell
Analytics_admin_service.delete_channel_groupsource codeOpen in Cloud Shell
Analytics_admin_service.delete_connected_site_tagsource codeOpen in Cloud Shell
Analytics_admin_service.delete_conversion_eventsource codeOpen in Cloud Shell
Analytics_admin_service.delete_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.delete_display_video360_advertiser_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_display_video360_advertiser_link_proposalsource codeOpen in Cloud Shell
Analytics_admin_service.delete_event_create_rulesource codeOpen in Cloud Shell
Analytics_admin_service.delete_event_edit_rulesource codeOpen in Cloud Shell
Analytics_admin_service.delete_expanded_data_setsource codeOpen in Cloud Shell
Analytics_admin_service.delete_firebase_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_google_ads_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_ios_app_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.delete_key_eventsource codeOpen in Cloud Shell
Analytics_admin_service.delete_measurement_protocol_secretsource codeOpen in Cloud Shell
Analytics_admin_service.delete_propertysource codeOpen in Cloud Shell
Analytics_admin_service.delete_rollup_property_source_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_s_k_ad_network_conversion_value_schemasource codeOpen in Cloud Shell
Analytics_admin_service.delete_search_ads360_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_subproperty_event_filtersource codeOpen in Cloud Shell
Analytics_admin_service.delete_user_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_web_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.fetch_automated_ga4_configuration_opt_outsource codeOpen in Cloud Shell
Analytics_admin_service.fetch_connected_ga4_propertysource codeOpen in Cloud Shell
Analytics_admin_service.get_access_bindingsource codeOpen in Cloud Shell
Analytics_admin_service.get_accountsource codeOpen in Cloud Shell
Analytics_admin_service.get_ad_sense_linksource codeOpen in Cloud Shell
Analytics_admin_service.get_android_app_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.get_attribution_settingssource codeOpen in Cloud Shell
Analytics_admin_service.get_audiencesource codeOpen in Cloud Shell
Analytics_admin_service.get_big_query_linksource codeOpen in Cloud Shell
Analytics_admin_service.get_calculated_metricsource codeOpen in Cloud Shell
Analytics_admin_service.get_channel_groupsource codeOpen in Cloud Shell
Analytics_admin_service.get_conversion_eventsource codeOpen in Cloud Shell
Analytics_admin_service.get_custom_dimensionsource codeOpen in Cloud Shell
Analytics_admin_service.get_custom_metricsource codeOpen in Cloud Shell
Analytics_admin_service.get_data_redaction_settingssource codeOpen in Cloud Shell
Analytics_admin_service.get_data_retention_settingssource codeOpen in Cloud Shell
Analytics_admin_service.get_data_sharing_settingssource codeOpen in Cloud Shell
Analytics_admin_service.get_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.get_display_video360_advertiser_linksource codeOpen in Cloud Shell
Analytics_admin_service.get_display_video360_advertiser_link_proposalsource codeOpen in Cloud Shell
Analytics_admin_service.get_enhanced_measurement_settingssource codeOpen in Cloud Shell
Analytics_admin_service.get_event_create_rulesource codeOpen in Cloud Shell
Analytics_admin_service.get_event_edit_rulesource codeOpen in Cloud Shell
Analytics_admin_service.get_expanded_data_setsource codeOpen in Cloud Shell
Analytics_admin_service.get_global_site_tagsource codeOpen in Cloud Shell
Analytics_admin_service.get_google_signals_settingssource codeOpen in Cloud Shell
Analytics_admin_service.get_ios_app_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.get_key_eventsource codeOpen in Cloud Shell
Analytics_admin_service.get_measurement_protocol_secretsource codeOpen in Cloud Shell
Analytics_admin_service.get_propertysource codeOpen in Cloud Shell
Analytics_admin_service.get_rollup_property_source_linksource codeOpen in Cloud Shell
Analytics_admin_service.get_s_k_ad_network_conversion_value_schemasource codeOpen in Cloud Shell
Analytics_admin_service.get_search_ads360_linksource codeOpen in Cloud Shell
Analytics_admin_service.get_subproperty_event_filtersource codeOpen in Cloud Shell
Analytics_admin_service.get_user_linksource codeOpen in Cloud Shell
Analytics_admin_service.get_web_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.list_access_bindingssource codeOpen in Cloud Shell
Analytics_admin_service.list_account_summariessource codeOpen in Cloud Shell
Analytics_admin_service.list_accountssource codeOpen in Cloud Shell
Analytics_admin_service.list_ad_sense_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_android_app_data_streamssource codeOpen in Cloud Shell
Analytics_admin_service.list_audiencessource codeOpen in Cloud Shell
Analytics_admin_service.list_big_query_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_calculated_metricssource codeOpen in Cloud Shell
Analytics_admin_service.list_channel_groupssource codeOpen in Cloud Shell
Analytics_admin_service.list_connected_site_tagssource codeOpen in Cloud Shell
Analytics_admin_service.list_conversion_eventssource codeOpen in Cloud Shell
Analytics_admin_service.list_custom_dimensionssource codeOpen in Cloud Shell
Analytics_admin_service.list_custom_metricssource codeOpen in Cloud Shell
Analytics_admin_service.list_data_streamssource codeOpen in Cloud Shell
Analytics_admin_service.list_display_video360_advertiser_link_proposalssource codeOpen in Cloud Shell
Analytics_admin_service.list_display_video360_advertiser_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_event_create_rulessource codeOpen in Cloud Shell
Analytics_admin_service.list_event_edit_rulessource codeOpen in Cloud Shell
Analytics_admin_service.list_expanded_data_setssource codeOpen in Cloud Shell
Analytics_admin_service.list_firebase_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_google_ads_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_ios_app_data_streamssource codeOpen in Cloud Shell
Analytics_admin_service.list_key_eventssource codeOpen in Cloud Shell
Analytics_admin_service.list_measurement_protocol_secretssource codeOpen in Cloud Shell
Analytics_admin_service.list_propertiessource codeOpen in Cloud Shell
Analytics_admin_service.list_rollup_property_source_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_s_k_ad_network_conversion_value_schemassource codeOpen in Cloud Shell
Analytics_admin_service.list_search_ads360_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_subproperty_event_filterssource codeOpen in Cloud Shell
Analytics_admin_service.list_user_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_web_data_streamssource codeOpen in Cloud Shell
Analytics_admin_service.provision_account_ticketsource codeOpen in Cloud Shell
Analytics_admin_service.provision_subpropertysource codeOpen in Cloud Shell
Analytics_admin_service.reorder_event_edit_rulessource codeOpen in Cloud Shell
Analytics_admin_service.run_access_reportsource codeOpen in Cloud Shell
Analytics_admin_service.search_change_history_eventssource codeOpen in Cloud Shell
Analytics_admin_service.set_automated_ga4_configuration_opt_outsource codeOpen in Cloud Shell
Analytics_admin_service.update_access_bindingsource codeOpen in Cloud Shell
Analytics_admin_service.update_accountsource codeOpen in Cloud Shell
Analytics_admin_service.update_android_app_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.update_attribution_settingssource codeOpen in Cloud Shell
Analytics_admin_service.update_audiencesource codeOpen in Cloud Shell
Analytics_admin_service.update_big_query_linksource codeOpen in Cloud Shell
Analytics_admin_service.update_calculated_metricsource codeOpen in Cloud Shell
Analytics_admin_service.update_channel_groupsource codeOpen in Cloud Shell
Analytics_admin_service.update_conversion_eventsource codeOpen in Cloud Shell
Analytics_admin_service.update_custom_dimensionsource codeOpen in Cloud Shell
Analytics_admin_service.update_custom_metricsource codeOpen in Cloud Shell
Analytics_admin_service.update_data_redaction_settingssource codeOpen in Cloud Shell
Analytics_admin_service.update_data_retention_settingssource codeOpen in Cloud Shell
Analytics_admin_service.update_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.update_display_video360_advertiser_linksource codeOpen in Cloud Shell
Analytics_admin_service.update_enhanced_measurement_settingssource codeOpen in Cloud Shell
Analytics_admin_service.update_event_create_rulesource codeOpen in Cloud Shell
Analytics_admin_service.update_event_edit_rulesource codeOpen in Cloud Shell
Analytics_admin_service.update_expanded_data_setsource codeOpen in Cloud Shell
Analytics_admin_service.update_google_ads_linksource codeOpen in Cloud Shell
Analytics_admin_service.update_google_signals_settingssource codeOpen in Cloud Shell
Analytics_admin_service.update_ios_app_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.update_key_eventsource codeOpen in Cloud Shell
Analytics_admin_service.update_measurement_protocol_secretsource codeOpen in Cloud Shell
Analytics_admin_service.update_propertysource codeOpen in Cloud Shell
Analytics_admin_service.update_s_k_ad_network_conversion_value_schemasource codeOpen in Cloud Shell
Analytics_admin_service.update_search_ads360_linksource codeOpen in Cloud Shell
Analytics_admin_service.update_subproperty_event_filtersource codeOpen in Cloud Shell
Analytics_admin_service.update_user_linksource codeOpen in Cloud Shell
Analytics_admin_service.update_web_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.acknowledge_user_data_collectionsource codeOpen in Cloud Shell
Analytics_admin_service.archive_custom_dimensionsource codeOpen in Cloud Shell
Analytics_admin_service.archive_custom_metricsource codeOpen in Cloud Shell
Analytics_admin_service.create_conversion_eventsource codeOpen in Cloud Shell
Analytics_admin_service.create_custom_dimensionsource codeOpen in Cloud Shell
Analytics_admin_service.create_custom_metricsource codeOpen in Cloud Shell
Analytics_admin_service.create_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.create_firebase_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_google_ads_linksource codeOpen in Cloud Shell
Analytics_admin_service.create_key_eventsource codeOpen in Cloud Shell
Analytics_admin_service.create_measurement_protocol_secretsource codeOpen in Cloud Shell
Analytics_admin_service.create_propertysource codeOpen in Cloud Shell
Analytics_admin_service.delete_accountsource codeOpen in Cloud Shell
Analytics_admin_service.delete_conversion_eventsource codeOpen in Cloud Shell
Analytics_admin_service.delete_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.delete_firebase_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_google_ads_linksource codeOpen in Cloud Shell
Analytics_admin_service.delete_key_eventsource codeOpen in Cloud Shell
Analytics_admin_service.delete_measurement_protocol_secretsource codeOpen in Cloud Shell
Analytics_admin_service.delete_propertysource codeOpen in Cloud Shell
Analytics_admin_service.get_accountsource codeOpen in Cloud Shell
Analytics_admin_service.get_conversion_eventsource codeOpen in Cloud Shell
Analytics_admin_service.get_custom_dimensionsource codeOpen in Cloud Shell
Analytics_admin_service.get_custom_metricsource codeOpen in Cloud Shell
Analytics_admin_service.get_data_retention_settingssource codeOpen in Cloud Shell
Analytics_admin_service.get_data_sharing_settingssource codeOpen in Cloud Shell
Analytics_admin_service.get_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.get_key_eventsource codeOpen in Cloud Shell
Analytics_admin_service.get_measurement_protocol_secretsource codeOpen in Cloud Shell
Analytics_admin_service.get_propertysource codeOpen in Cloud Shell
Analytics_admin_service.list_account_summariessource codeOpen in Cloud Shell
Analytics_admin_service.list_accountssource codeOpen in Cloud Shell
Analytics_admin_service.list_conversion_eventssource codeOpen in Cloud Shell
Analytics_admin_service.list_custom_dimensionssource codeOpen in Cloud Shell
Analytics_admin_service.list_custom_metricssource codeOpen in Cloud Shell
Analytics_admin_service.list_data_streamssource codeOpen in Cloud Shell
Analytics_admin_service.list_firebase_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_google_ads_linkssource codeOpen in Cloud Shell
Analytics_admin_service.list_key_eventssource codeOpen in Cloud Shell
Analytics_admin_service.list_measurement_protocol_secretssource codeOpen in Cloud Shell
Analytics_admin_service.list_propertiessource codeOpen in Cloud Shell
Analytics_admin_service.provision_account_ticketsource codeOpen in Cloud Shell
Analytics_admin_service.run_access_reportsource codeOpen in Cloud Shell
Analytics_admin_service.search_change_history_eventssource codeOpen in Cloud Shell
Analytics_admin_service.update_accountsource codeOpen in Cloud Shell
Analytics_admin_service.update_conversion_eventsource codeOpen in Cloud Shell
Analytics_admin_service.update_custom_dimensionsource codeOpen in Cloud Shell
Analytics_admin_service.update_custom_metricsource codeOpen in Cloud Shell
Analytics_admin_service.update_data_retention_settingssource codeOpen in Cloud Shell
Analytics_admin_service.update_data_streamsource codeOpen in Cloud Shell
Analytics_admin_service.update_google_ads_linksource codeOpen in Cloud Shell
Analytics_admin_service.update_key_eventsource codeOpen in Cloud Shell
Analytics_admin_service.update_measurement_protocol_secretsource codeOpen in Cloud Shell
Analytics_admin_service.update_propertysource codeOpen in Cloud Shell
Quickstartsource codeOpen in Cloud Shell

The Google Analytics Admin 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-analytics/admin@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

Keywords

FAQs

Package last updated on 12 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc