API Reference / API Methods / Insights / Clicked Filters
Required API Key: any key with the settings ACL
Method signature
aa('clickedFilters', {
  userToken: string,
  index: string,
  eventName: string,
  filters: array,
});

About this method # A

You’re currently reading the JavaScript API client v4 documentation. Check the migration guide to learn how to upgrade from v3 to v4. You can still access the v3 documentation.

Send a click event to capture the filters a user clicks on.

You can’t send these events for numeric filters.

Examples # A

1
2
3
4
5
6
7
8
9
10
11
// This requires installing the search-insights separate library:
// https://github.com/algolia/search-insights.js
// https://www.npmjs.com/package/search-insights
// Compatible with Node.js since v1.3.0

aa('clickedFilters', {
  userToken: 'user-1', // required for Node.js
  index: 'your_index_name',
  eventName: 'your_index_name',
  filters: [ 'brand:apple' ]
});

Parameters # A

userToken #
type: string
Required

A user identifier.

Format: alpha numeric string [a-zA-Z0-9_-=/+]{1,128}

Length: between 1 and 64 characters.

eventName #
type: string
Required

Name of the event.

It’s best to follow the event naming guidelines.

Format: any ASCII character except control characters.

Length: between 1 and 64 characters.

indexName #
type: string
Required

Name of the index related to the click.

filters #
type: string[]
Required

A list of filters.

Format: ${attr}:${value} e.g. brand:apple.

Limited to 10 filters.

Response # A

No response

Did you find this page helpful?
JavaScript v4