Post Analytics Report

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:

  • period
  • domain – the domain selected
  • userType – specifies if consent was given by new or existing user(s):
    • New User – a user that has not given consent and does not have consent cookie stored at that time
    • Existing User – a user that has given consent and has a consent cookie stored at that time
  • deviceType – device type of the user when they set a consent value (MOBILE, TABLET, DESKTOP, or UNKNOWN)
  • impressions – total impressions
  • uniqueImpressions – unique impressions

For more information, see the Result Variables.

Success Response Code: 200 OK
Error Response

Code: 400 Bad Request

Code: 401 Unauthorized

Code: 403 Forbidden

Code: 404 Not Found

 

Result Variables

Data Model

{

  "period": "OffsetDateTime - ISO format",

  "domain": "string",

  "userType": "NEW | EXISTING",

  "deviceType": "MOBILE | TABLET | DESKTOP | UNKNOWN",

  "deviceOs": "ANDROID | IOS | WINDOWS | MAC | LINUX | UNKNOWN",

  "country": "string - ISO country code",

  "behavior": "EXPRESSED | IMPLIED |",

  "consentLocation": "string",

  "impressions": "long",

  "uniqueImpressions": "long",

  "bannerViews*": "long",

  "bannerUniqueViews*": "long",

  "bannerAccepts": "long",

  "bannerMoreInfo": "long",

  "bannerCookiePolicy": "long",

  "bannerRequiredOnly": "long",

  "bannerTwoStepOptIns": "long",

  "bannerOptInRate": "float",

  "bannerOptOutRate": "float",

  "modalViews*": "long", 

  "modalUniqueViews*": "long",

  "modalClicks": "long",

  "modalUniqueClicks": "long",

  "modalAgree": "long",

  "modalAcceptAll": "long",

  "modalDeclineAll": "long",

  "modalRequiredOnly": "long",

  "modalMoreInfo": "long",

  "modalAskMeLater": "long",

  "modalClose": "long",

  "modalGpcDnt": "long",

  "modalTwoStepOptIns": "long",

  "modalRequiredOptIns": "long",

  "modalFunctionalOptIns": "long",

  "modalAdvertisingOptIns": "long",

  "modalOptIns": "long",

  "modalOptOutsAll": "long",

  "modalOptInsAll": "long",

  "bannerAcceptsRate": "float (deprecated)",

  "bannerDeclineAllRate": "float (deprecated)",

  "bannerMoreInfoRate": "float (deprecated)",

  "bannerTwoStepOptInsRate": "float (deprecated)",

  "bannerCookiePolicyRate": "float (deprecated)",

  "modalInterstitialViews": "long",

  "modalOptInRate": "float",

  "modalOptOutRate": "float",

  "optInRate": "float",

  "optOutRate": "float",

  "modalAcceptRate": "float", (deprecated to be removed) 

  "modalDeclineAllRate": "float",(deprecated) 

  "modalAskMeLaterRate": "float",(deprecated) 

  "modalMoreInfoRate": "float",(deprecated) 

  "modalCloseRate": "float",(deprecated) 

  "modalBounceRate": "float",(deprecated) 

  "modalIgnoredRate": "float",(deprecated) 

  "modalRequiredOptInsRate": "float",(deprecated) 

  "modalFunctionalOptInsRate": "float",(deprecated) 

  "modalAdvertisingOptInsRate": "float",(deprecated) 

  "categoryOptIns": "array of CategoryOptInsFact"

}

 

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