setAnalyticsTags method

AlgoliaQuery setAnalyticsTags(
  1. List<String> value
)

AnalyticsTags

List of tags to apply to the query for analytics purposes.

You can use tags in analytics to filter searches. For example, you can send two different tags - mobile and website - to see how mobile users search in comparison to website users.

There are a couple of limitations to keep in mind when sending analytics tags:

  • Tags can be up to 100 characters long. Longer tags are ignored.
  • Tags starting with alg# are reserved for internal usage and are ignored.
  • A query has a maximum of 10 unique tags. Extra tags are ignored.
  • A maximum of 3,500 unique tags combinations is processed per 5-minute window. All extra tags are ignored. A tags combination is the list of tags found in a query. For example, sending 3 queries, each respectively tagged with platform:ios, lang:en, and platform:ios,lang:en, counts as 3 combinations.

Usage notes:

  • Algolia captures analytics on every search. This is the default setting. Therefore, this setting’s primary use is to turn analytics off for a given query.

Source: Learn more

Implementation

AlgoliaQuery setAnalyticsTags(List<String> value) {
  assert(value.isNotEmpty, 'value can not be empty');
  assert(!_parameters.containsKey('analyticsTags'));
  return _copyWithParameters(<String, dynamic>{'analyticsTags': value});
}