Post Event to an Analytics Collectionedit
This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.
Post an event to an Analytics Collection.
Requestedit
POST _application/analytics/<collection_name>/event/<event_type>
Path parametersedit
-
<collection_name>
- (Required, string) Analytics collection name you want to ingest event in.
-
<event_type>
-
(Required, string) Analytics event type. Can be one of
page_view
,search
,search_click
.
Request bodyedit
Full request body parameters can be found in Enterprise Analytics Events.
Prerequisitesedit
Requires the post_behavioral_analytics_event
cluster privilege.
Response codesedit
-
202
- Event has been accepted and will be ingested.
-
404
-
Analytics Collection
<collection_name>
does not exists. -
400
- Occurs either when the event type is unknown or when event payload contains invalid data.
Examplesedit
The following example send a search_click
event to an Analytics Collection called my_analytics_collection
:
POST _application/analytics/my_analytics_collection/event/search_click { "session": { "id": "1797ca95-91c9-4e2e-b1bd-9c38e6f386a9" }, "user": { "id": "5f26f01a-bbee-4202-9298-81261067abbd" }, "search":{ "query": "search term", "results": { "items": [ { "document": { "id": "123", "index": "products" } } ], "total_results": 10 }, "sort": { "name": "relevance" }, "search_application": "website" }, "document":{ "id": "123", "index": "products" } }