Skip to main content
Version: 24.05

Views - View Segments

Endpoint​

/o?method=get_view_segments

Overview​

Returns the segments recorded for views in an app, the segments that are omitted from view data, and the domains seen in view actions.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

Requires views Read permission.

Request Parameters​

ParameterTypeRequiredDescription
methodStringYesMust be get_view_segments.
app_idStringYesTarget app ID.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples​

Example 1: Read view segments​

/o?method=get_view_segments&
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2

Response​

Success Response​

{
"segments": {
"platform": ["iOS", "Android"]
},
"domains": ["example.com"],
"omit": ["utm_source"]
}

Response Fields​

FieldTypeDescription
segmentsObjectView segments of the app. Each key is a segment name and its value is the list of segment values. Empty array when the app has none.
domainsArrayDomains seen in view actions. Empty when none are known or when Drill is not available.
omitArraySegments omitted from view data. Only present when some are omitted.

Behavior​

  • Domains are collected from the Drill metadata of the view action event.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.viewsApp-level view configurationReads the segment map and omitted segments.
countly_drill.drill_meta{appId}Drill metadataReads the known domains of view actions.