Skip to main content
Version: 26.01

Views - View Segments Read

Endpoint​

/o?method=get_view_segments

Overview​

Returns the segment keys recorded for views of an app, the omitted segments, 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_idStringYesApplication ID.
skip_domainsBoolean/StringNoWhen set, domains is not looked up and is returned empty.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples​

Read view segments​

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

Response​

Success Response​

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

Response Fields​

FieldTypeDescription
segmentsObjectMap of segment key to the list of values recorded for it. Empty when the app has no segments.
domainsArrayDomains found in view actions.
omitArrayOmitted segments. Present only when segments have been omitted for the app.

Behavior​

  • Returns empty segments and domains when the app has no stored view data.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.viewsSegments and omitted segmentsReads the app's views configuration document.
countly_drill metadataDomainsReads domain values of view actions.