Account & Property Management
��� Accounts API
List Accounts
Endpoint: GET /v1/integrations/google/analytics/accounts
Query Parameters:
accountID(optional) - Specific account IDpropertyID(optional) - Specific property ID (requires accountID)viewID(optional) - Specific view ID (requires propertyID and accountID)version(optional) - "v3" or "v4"limit(optional) - Results per page (default: 20)page(optional) - Page number (default: 1)nextPageToken(optional) - v4 pagination token
Conditional Logic:
- All Three (
accountID+propertyID+viewID): Return specific account, property, and view - Account + Property: Return account, property, and list of views
- Account Only: Return account and list of properties
- No Parameters: Return list of all accounts
��� Examples
List All Accounts (v3)
Request:
GET /v1/integrations/google/analytics/accounts?version=v3&limit=100&page=1
Authorization: Bearer {jwt_token}
Response:
{
"success": true,
"message": "SUCCESS",
"data": {
"account": [
{
"id": "167475709",
"kind": "analytics#account",
"name": "Test Dashclicks",
"permissions": {
"effective": ["COLLABORATE", "EDIT", "MANAGE_USERS", "READ_AND_ANALYZE"]
},
"created": "2020-05-23T09:50:33.369Z",
"updated": "2020-05-23T09:50:33.369Z"
}
]
},
"pagination": {
"page": 1,
"limit": 100,
"total": 2,
"next_page": null,
"prev_page": null
}
}
List All Accounts (v4/GA4)
Request:
GET /v1/integrations/google/analytics/accounts?version=v4&limit=50
Authorization: Bearer {jwt_token}
Response:
{
"success": true,
"message": "SUCCESS",
"data": {
"account": [
{
"id": "167475709",
"name": "Test Dashclicks"
}
],
"nextPageToken": "CgwI4Pjd_QUQmNT_bA=="
}
}
Get Account with Properties
Request:
GET /v1/integrations/google/analytics/accounts?accountID=167475709&limit=20
Authorization: Bearer {jwt_token}
Response:
{
"success": true,
"message": "SUCCESS",
"data": {
"account": {
"id": "167475709",
"name": "Test Dashclicks"
},
"property": [
{
"id": "UA-167475709-1",
"name": "My Website"
}
]
},
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
��� Properties API
List Properties
Endpoint: GET /v1/integrations/google/analytics/:accountid/properties
Path Parameters:
accountid(required) - Google Analytics account ID
Query Parameters:
version(optional) - "v3" or "v4" (default: "v3")limit(optional) - Results per page (default: 20)page(optional) - Page number for v3pageToken(optional) - Pagination token for v4subaccountid(optional) - DashClicks sub-account ID
Example (v3)
Request:
GET /v1/integrations/google/analytics/167475709/properties?version=v3&limit=20&page=1
Authorization: Bearer {jwt_token}
Response:
{
"success": true,
"message": "SUCCESS",
"data": [
{
"id": "UA-167475709-1",
"name": "My Website"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
Example (v4)
Request:
GET /v1/integrations/google/analytics/167475709/properties?version=v4&limit=50
Authorization: Bearer {jwt_token}
Response:
{
"success": true,
"message": "SUCCESS",
"data": [
{
"id": "12345678",
"name": "My GA4 Property"
}
],
"pagination": {
"nextPageToken": "CgwI4Pjd_QUQmNT_bA=="
}
}
���️ Views API
List Views
Endpoint: GET /v1/integrations/google/analytics/:accountid/properties/:propertyid/views
Path Parameters:
accountid(required) - Google Analytics account IDpropertyid(required) - Property ID (web property)
Query Parameters:
limit(optional) - Results per page (default: 20)page(optional) - Page number (default: 1)subaccountid(optional) - DashClicks sub-account ID
Example
Request:
GET /v1/integrations/google/analytics/167475709/properties/UA-167475709-1/views?limit=20&page=1
Authorization: Bearer {jwt_token}
Response:
{
"success": true,
"message": "SUCCESS",
"data": [
{
"id": "219224050",
"name": "All Web Site Data"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
��� Provider Methods
getAccountsList()
Purpose: Get list of GA4 accounts
API: GET https://analyticsadmin.googleapis.com/v1alpha/accountSummaries
Parameters: pageSize, pageToken
Returns: { accountSummaries: [], nextPageToken }
getPropertiesList()
Purpose: Get list of GA4 properties
API: GET https://analyticsadmin.googleapis.com/v1alpha/properties
Parameters: filter, pageSize, pageToken
Filter Example: parent:accounts/167475709
Returns: { properties: [], nextPageToken }
��� Version Differences
v3 (Universal Analytics)
- Structure: Account → Property → View
- Pagination: Page-based (
page,limit) - View ID Required: For reporting
- Legacy: Being phased out by Google
v4 (Google Analytics 4)
- Structure: Account → Property (no views)
- Pagination: Token-based (
nextPageToken) - Property ID Used: For reporting
- Modern: Event-based analytics
⚠️ Important Notes
- ��� Version Support: Both v3 and v4 APIs supported
- ��� Auto Token Refresh: Tokens refreshed automatically before each call
- ��� Sub-account Support: Works with DashClicks sub-accounts
- ��� Pagination: v3 uses page/limit, v4 uses pageToken
- ��� Scope Flexibility: Accepts 'analytics' OR 'ads' scope
- ��� Large Accounts: Handles 1000+ accounts with automatic paging