5.7 KiB
5.7 KiB
Google Analytics Admin Routing Reference
App name: google-analytics-admin
Base URL proxied: analyticsadmin.googleapis.com
API Path Pattern
/google-analytics-admin/v1beta/{endpoint}
Common Endpoints
List Accounts
GET /google-analytics-admin/v1beta/accounts
Get Account
GET /google-analytics-admin/v1beta/accounts/{accountId}
List Properties
GET /google-analytics-admin/v1beta/properties?filter=parent:accounts/{accountId}
Get Property
GET /google-analytics-admin/v1beta/properties/{propertyId}
Create Property
POST /google-analytics-admin/v1beta/properties
Content-Type: application/json
{
"parent": "accounts/{accountId}",
"displayName": "My New Property",
"timeZone": "America/Los_Angeles",
"currencyCode": "USD",
"industryCategory": "TECHNOLOGY"
}
Update Property
PATCH /google-analytics-admin/v1beta/properties/{propertyId}?updateMask=displayName
Content-Type: application/json
{
"displayName": "Updated Property Name"
}
List Data Streams
GET /google-analytics-admin/v1beta/properties/{propertyId}/dataStreams
Get Data Stream
GET /google-analytics-admin/v1beta/properties/{propertyId}/dataStreams/{dataStreamId}
Create Web Data Stream
POST /google-analytics-admin/v1beta/properties/{propertyId}/dataStreams
Content-Type: application/json
{
"type": "WEB_DATA_STREAM",
"displayName": "My Website",
"webStreamData": {
"defaultUri": "https://example.com"
}
}
List Custom Dimensions
GET /google-analytics-admin/v1beta/properties/{propertyId}/customDimensions
Create Custom Dimension
POST /google-analytics-admin/v1beta/properties/{propertyId}/customDimensions
Content-Type: application/json
{
"parameterName": "user_type",
"displayName": "User Type",
"scope": "USER",
"description": "Type of user (free, premium, enterprise)"
}
List Custom Metrics
GET /google-analytics-admin/v1beta/properties/{propertyId}/customMetrics
Create Custom Metric
POST /google-analytics-admin/v1beta/properties/{propertyId}/customMetrics
Content-Type: application/json
{
"parameterName": "points_earned",
"displayName": "Points Earned",
"scope": "EVENT",
"measurementUnit": "STANDARD",
"description": "Number of loyalty points earned"
}
List Conversion Events
GET /google-analytics-admin/v1beta/properties/{propertyId}/conversionEvents
Create Conversion Event
POST /google-analytics-admin/v1beta/properties/{propertyId}/conversionEvents
Content-Type: application/json
{
"eventName": "purchase"
}
Get Measurement Protocol Secret
GET /google-analytics-admin/v1beta/properties/{propertyId}/dataStreams/{dataStreamId}/measurementProtocolSecrets
Create Measurement Protocol Secret
POST /google-analytics-admin/v1beta/properties/{propertyId}/dataStreams/{dataStreamId}/measurementProtocolSecrets
Content-Type: application/json
{
"displayName": "Server-side tracking"
}
Account Summaries
List Account Summaries
GET /google-analytics-admin/v1beta/accountSummaries
Returns a lightweight summary of all accounts and properties the user has access to.
Data Stream Types
WEB_DATA_STREAM- Website trackingANDROID_APP_DATA_STREAM- Android appIOS_APP_DATA_STREAM- iOS app
Custom Dimension Scopes
EVENT- Dimension applies to eventsUSER- Dimension applies to users
Custom Metric Scopes
EVENT- Metric applies to events
Measurement Units (Custom Metrics)
STANDARD- Integer or decimalCURRENCY- Currency valueFEET,METERS- DistanceMILES,KILOMETERS- DistanceMILLISECONDS,SECONDS,MINUTES,HOURS- Time
Industry Categories
AUTOMOTIVE,BUSINESS_AND_INDUSTRIAL_MARKETS,FINANCE,HEALTHCARETECHNOLOGY,TRAVEL,RETAIL,REAL_ESTATE,GAMESARTS_AND_ENTERTAINMENT,BEAUTY_AND_FITNESS,BOOKS_AND_LITERATUREFOOD_AND_DRINK,HOBBIES_AND_LEISURE,HOME_AND_GARDENINTERNET_AND_TELECOM,JOBS_AND_EDUCATION,LAW_AND_GOVERNMENTNEWS,ONLINE_COMMUNITIES,PEOPLE_AND_SOCIETY,PETS_AND_ANIMALSREFERENCE,SCIENCE,SHOPPING,SPORTS
Notes
- Authentication is automatic - the router injects the OAuth token
- Property IDs are numeric (e.g.,
properties/521310447) - Account IDs are numeric (e.g.,
accounts/123456789) - GA4 properties only (Universal Analytics not supported)
- Use
accountSummariesendpoint to quickly list all accessible properties - The
filterparameter on list properties uses format:parent:accounts/{accountId} - Use
updateMaskquery parameter to specify which fields to update in PATCH requests - This API is for property/account management - use the Data API for running reports