Analytics Admin Service
Stay organized with collections
Save and categorize content based on your preferences.
The Analytics Admin service lets you use the
Google Analytics Admin API v1 in
Google Apps Script. The Google Analytics Admin API provides programmatic
access to the Google Analytics 4 (GA4) configuration data and is only
compatible with GA4 properties.
Like all advanced services in Apps Script, the AnalyticsAdmin
service uses the same objects, methods, and parameters as the public API. For
more information, see
How method signatures are determined.
/** * Logs the Google Analytics accounts accessible by the current user. */functionlistAccounts(){try{accounts=AnalyticsAdmin.Accounts.list();if(!accounts.items||!accounts.items.length){console.log("No accounts found.");return;}for(leti=0;i < accounts.items.length;i++){constaccount=accounts.items[i];console.log('Account: name "%s", displayName "%s".',account.name,account.displayName,);}}catch(e){// TODO (Developer) - Handle exceptionconsole.log("Failed with error: %s",e.error);}}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-09-03 UTC."],[],[]]