Obtain user consent
The ability to place cookies in a user’s browser to track recurring activity on your site is essential to support Algolia features such as personalization, analytics, and A/B testing. However, in many regions and countries, it’s a legal requirement to obtain the user’s consent before doing so. Two types of consent are supported by the Algolia extension:- Implied
- Expressed

Cookie restriction mode
To configure Algolia’s cookie collection policy for expressed consent, ensure that you’ve assigned the correct cookie restriction mode. To do this, go to General > Web > Default Cookie Settings > Cookie Restriction Mode and adjust as follows:-
No implies that the user has already consented to use cookies.
Therefore, the
useCookie
parameter is set totrue
for all Insights events. - Yes. Insights events won’t set a cookie in the user’s browser without their explicit consent.

Algolia cookie configuration
With cookie restriction mode enabled, Algolia sets its cookies accordingly. Algolia Cookie Configuration lets you configure things further. Here you can:- Override the default consent cookie name
- Specify the DOM selector ID for the cookie acceptance button
- Adjust the duration of Algolia cookies

- Consent Cookie Name (default is
user_allowed_save_cookie
) - Allow Cookie Button Selector (default is
#btn-cookie-allow
).
How to get the selector for the “Allow Cookies” button
