Update post-analytics-collection-event.asciidoc (#97826)

* Update post-analytics-collection-event.asciidoc

Update API endpoint. Instead of `click`, it should be `search_click`. 

Expanded on request body in the API as well.

* Update post-analytics-collection-event.asciidoc

* Update post-analytics-collection-event.asciidoc

* Update post-analytics-collection-event.asciidoc
This commit is contained in:
Leaf-Lin 2023-08-15 09:08:14 +10:00 committed by GitHub
parent e693a2b820
commit db078f78dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,7 +22,12 @@ Post an event to an Analytics Collection.
(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`, `click`
(Required, string) Analytics event type. Can be one of `page_view`, `search`, `search_click`.
[[post-analytics-collection-event-request-body]]
==== {api-request-body-title}
Full request body parameters can be found in {enterprise-search-ref}/analytics-events-reference.html[Enterprise Analytics Events^].
[[post-analytics-collection-event-prereqs]]
==== {api-prereq-title}
@ -44,11 +49,11 @@ Occurs either when the event type is unknown or when event payload contains inva
[[post-analytics-collection-event-example]]
==== {api-examples-title}
The following example send a `page_view` event to an Analytics Collection called `my_analytics_collection`:
The following example send a `search_click` event to an Analytics Collection called `my_analytics_collection`:
[source,console]
----
POST _application/analytics/my_analytics_collection/event/page_view
POST _application/analytics/my_analytics_collection/event/search_click
{
"session": {
"id": "1797ca95-91c9-4e2e-b1bd-9c38e6f386a9"
@ -56,8 +61,27 @@ POST _application/analytics/my_analytics_collection/event/page_view
"user": {
"id": "5f26f01a-bbee-4202-9298-81261067abbd"
},
"page": {
"url": "https://www.elastic.co/"
"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"
}
}
----