Register a Session-Source Query
Registers an asynchronous Session/Source analysis query and returns a request_id. Session/Source analysis reports session count or average session duration, broken down by acquisition attributes such as source, medium, and campaign.
Use the request_id with Get Query Status to poll for completion, then Get Query Results to fetch the resolved series.
Authorizations
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format username:password.
- Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
- Password: Use your Data API Key, which you can find in the MoEngage dashboard at Settings > Account > APIs.
For more information, see Authentication.
Body
Request body for registering a Session/Source analysis query.
The analysis type. Must be session-source for this endpoint.
session-source The session metric to compute.
session_count, average_session_duration The time window the analysis runs over.
Payload schema version.
"2.0"
Conditions on acquisition attributes (source, medium, campaign, and so on). Combined with grouped_by, at most 2 source properties may be used.
Acquisition properties to break the report down by (for example, source and medium). Include up to 2.
2Segments used to scope the analysis to a subset of users. Include up to 5 segments. To analyze all users, pass a single segment with the All Users custom segment.
5Time bucket for the series — h (hour), d (day), w (week), or m (month). When hourly, the time range must not exceed 31 days.
h, d, w, m "d"
Visual representation of the result, such as line.
"line"
Whether metrics are returned as absolute counts or percentages, such as number.
"number"
A second time range to compare against. Time comparison is supported only on line, bar, and column charts, and cannot be combined with custom-segment comparison (2 or more segments). Pass an empty object for no comparison.
Sort order applied to the result series.
ascending, descending Response
Query registered. Poll status and fetch results with data.request_id.
Acknowledgement that a query was registered. Use data.request_id to poll status and fetch results.