SearchStax Site Search Analytics uses cookies to track the user’s search behavior. This page contains FAQ information about Site Search cookie usage topics.
Analytics Cookies
Site Search Analytics uses the following cookies:
| Name | Purpose |
|---|---|
ms_visitorid
|
This cookie is used to identify a user/visitor uniquely. |
searchstax_session_id
|
This cookie is used to uniquely identify a user session. In an older toolkit (Legacy Vue2 accelerator), this cookie was named searchcookie).
|
Drupal Cookie Consent Options
If you use SearchStax Site Search with Drupal, you have two options for controlling analytics tracking.
- EU Cookie Compliance integration: The SearchStax Drupal module integrates with the Drupal EU Cookie Compliance module. When this integration is enabled, users can accept or decline tracking through that consent flow.
- Custom consent integration: If your site uses a different consent manager, your developer can prevent SearchStax tracking by listening for the
searchstax:trackSearchResultsandsearchstax:trackClickevents and callingevent.preventDefault()after a user opts out.
If you use the Drupal EU Cookie Compliance integration, confirm the consent behavior in your own implementation. When it's working as expected, declining consent doesn't trigger the SearchStax analytics request or create the ms_visitorid cookie.
Note: To use this integration in Drupal, install the EU Cookie Compliance module and configure it to show a decline option. The SearchStax consent-related settings appear only when that module is available.
Custom Override Instructions
If you manage consent outside the Drupal EU Cookie Compliance module, your developer can override tracking with JavaScript events.
Before SearchStax tracks search results, it triggers the searchstax:trackSearchResults event on the document object. Before it tracks a click, it triggers the searchstax:trackClick event. Your developer can listen for those events and call event.preventDefault() if a user opts out of tracking.
Your developer can override tracking in four steps:
- Listen for
searchstax:trackSearchResults. - Check whether the user has opted out of tracking.
- Call
event.preventDefault()to stop the tracking request. - Repeat the same pattern for
searchstax:trackClick.
Use this approach if your site uses a custom consent manager and you need SearchStax tracking to follow that consent logic. The exact implementation depends on your site's consent tooling and frontend setup.
How to Stop Cookie Generation
With the Search UI App v3 (deprecated), it was possible to stop cookies from being generated by modifying a single line of code in your custom search webpage from:
constsession=getOrSetCookie('searchcookie');
To:
constsession=null;
The new UI Kits v4 have the same ability, but you must invoke it differently.
window.onload=function () {
var cookieNamesToCheck = ["searchcookie", "ms_visitorid"];
if (isAnyCookieRejected(cookieNamesToCheck)) {
searchstax.setCookiesDisabled()
}
};
The section you previously set to null should now be searchstax.setCookiesDisabled().
Questions?
Do not hesitate to contact the SearchStax Support Desk.