Skip to main content
POST
/
locations
/
api
/
v1
/
public
/
widget-events
Track widget analytics events
curl --request POST \
  --url https://www.closient.com/locations/api/v1/public/widget-events \
  --header 'Content-Type: application/json' \
  --data '
{
  "event": "widget_load",
  "api_key": "",
  "referrer": "",
  "query": "",
  "location_short_id": ""
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.closient.com/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json
event
enum<string>
required

Funnel stage of the widget interaction. See WidgetEventType for the allowed values.

Available options:
widget_load,
location_search,
view_store_click,
get_directions_click
Example:

"widget_load"

api_key
string
default:""

Publishable API key (cpk_*) that triggered the event. Only the first 12 characters are logged so we can attribute traffic to an org without storing the full key.

referrer
string
default:""

Page where the widget was embedded, taken from document.referrer. Truncated to 512 characters in logs.

query
string
default:""

Free-text search query the user typed. Set on location_search events only; ignored otherwise. Truncated to 256 characters in logs.

location_short_id
string
default:""

short_id of the location the user clicked through to. Set on view_store_click and get_directions_click events only.

Response

204

No Content