This retrieves paginated aggregated analytics report data with request body filters.
POST /analytics
| Method | POST | ||
| URL | https://api.trustarc.com/api/ccm-reporting/analytics |
||
| Headers |
Authorization: Bearer <access_token from 'Token Access' section>
|
||
| Sample Request | {
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"periodDimension": "DAY",
"from": "2025-01-01T00:00:00Z",
"to": "2025-01-31T23:59:59Z",
"userTypes": ["NEW", "EXISTING"],
"domains": ["example.com", "test.com"],
"countries": ["US", "CA"],
"states": ["CA", "NY"],
"behaviors": ["EXPRESSED", "IMPLIED"],
"deviceTypes": ["DESKTOP", "MOBILE"],
"deviceOSs": ["WINDOWS", "ANDROID"],
"consentLocation": "banner",
"consentLocations": ["banner", "modal"],
"groupBy": ["DOMAIN", "USER_TYPE"],
"includeCategoriesOptIns": false,
"columns": [“period”, “domain”, “userType”, “deviceType”, "impressions", "uniqueImpressions"]
} |
||
| Sample Success Response |
{
"content": [
{
"period": "2025-01-01T00:00:00Z",
"domain": "example.com",
"userType": "NEW",
"deviceType": null,
"impressions": 1500,
"uniqueImpressions": 1200 }
],
"pageable": {
"sort": {
"sorted": true,
"unsorted": false
},
"pageNumber": 0,
"pageSize": 20
},
"hasNext": true,
"numberOfElements": 20
}
Where:
For more information, see the Result Variables. |
||
| Success Response |
Code: 200 OK
|
||
| Error Response |
|
||
Result Variables
| Data Model |
|
||
Core Dimensions
| Field | Type | Description |
period |
OffsetDateTime | Time period (ISO 8601 format) |
domain |
String | Website domain |
userType |
String | User classification (NEW, EXISTING) |
deviceType |
String | Device category (MOBILE, TABLET, DESKTOP, UNKNOWN) |
deviceOs |
String | Operating system (ANDROID, IOS, WINDOWS, MAC, LINUX, UNKNOWN) |
country |
String | Country code |
behavior |
String | Consent behavior (EXPRESSED, IMPLIED, UNKNOWN) |
consentLocation |
String | Where consent was captured |
Core Metrics
| Field | Type | Description |
impressions |
Long | Total impressions |
uniqueImpressions |
Long | Unique user impressions |
Banner Report Metrics
| Field | Type | Description |
bannerViews |
Long | banner views |
bannerUniqueViews |
Long | Unique banner views |
bannerAccepts |
Long | Banner accept clicks |
bannerMoreInfo |
Long | Banner "more info" clicks |
bannerCookiePolicy |
Long | Banner cookie policy clicks |
bannerRequiredOnly |
Long | Banner "required only" clicks |
bannerTwoStepOptIns |
Long | Banner two-step opt-ins |
Preferences Modal Report Metrics
| Field | Type | Description |
modalViews |
Long | Total modal views |
modalUniqueViews |
Long | Unique modal views |
modalClicks |
Long | Total modal clicks |
modalUniqueClicks |
Long | Unique modal clicks |
modalAgree |
Long | Modal agree clicks |
modalAcceptAll |
Long | Modal "accept all" clicks |
modalDeclineAll |
Long | Modal "decline all" clicks |
modalRequiredOnly |
Long | Modal "required only" clicks |
modalMoreInfo |
Long | Modal "more info" clicks |
modalAskMeLater |
Long | Modal "ask me later" clicks |
modalClose |
Long | Modal close clicks |
modalGpcDnt |
Long | Modal GPC/DNT interactions |
modalTwoStepOptIns |
Long | Modal two-step opt-ins |
modalRequiredOptIns |
Long | Modal required opt-ins |
modalFunctionalOptIns |
Long | Modal functional opt-ins |
modalAdvertisingOptIns |
Long | Modal advertising opt-ins |
modalOptIns |
Long | Total modal opt-ins |
modalOptOutsAll |
Long | Modal opt-outs (all) |
modalOptInsAll |
Long | Modal opt-ins (all) |
modalInterstitialViews |
Long | Modal interstitial views |
Preferences Modal Category Opt-ins
| Field | Type | Description |
categoryOptIns |
Array[CategoryOptInsFact] | Category-specific opt-in data |
NOTE: This is available only when the domain filter contains a single domain, groupBy DOMAIN is specified, the domain is included in the selected columns, and includeCategoriesOptIns is set to true.
CategoryOptInsFact Structure
| Field | Type | Description | Possible Values |
categoryName |
String | Name of the cookie category | Any category name |
optIns |
Long | Number of opt-ins for this category | Numeric value |
categoryType |
String | Type of cookie category |
REQUIRED, FUNCTIONAL, ADVERTISING, OTHER
|