Skip to main content
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
If you opt to rely on implied consent then it will require careful legal language to ensure that users clearly understand that by using your site they’re agreeing to the use of cookies. Magento and Adobe Commerce also come pre-packaged with the ability to obtain expressed consent: Screenshot of a cookie consent form with a yellow background, a message about using cookies, and a blue 'Allow Cookies' button. The latest version of the Algolia Magento extension supports this feature of Magento out-of-the-box, although some configuration is required. 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 to true for all Insights events.
  • Yes. Insights events won’t set a cookie in the user’s browser without their explicit consent.
To require expressed consent, enable cookie restriction mode 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
To examine your cookie settings, go to Stores > Configuration > Algolia Search > Credentials and Basic Setup > Algolia Cookie Configuration in the Magento Admin panel. Screenshot of Algolia Cookie Configuration form with fields for Consent Cookie Name, Allow Cookie Button Selector, and Algolia Cookie Duration. If you’ve incorporated any third-party extensions or made customizations to the cookies on your website, you must update:
  • 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

Screenshot of a cookie consent banner with a blue 'Allow Cookies' button, a red arrow, and text instructing to retrieve the DOM Selector ID or class. If you’re using the default Magento cookie notification, no changes are required. If you use a custom notification, copy the cookie button selector ID from your website’s cookie notification setup.
Last modified on February 18, 2026