Cookie script for Bitrix: a simple solution to comply with the law and improve UX

A website on the 1C-Bitrix platform cannot do without a cookie notification. This is not just a requirement of the law, but also an important element of trust, security and SEO. In this article, we will explain why a cookie banner is required and how to embed it on the Bitrix website using a simple, free solution from QForm.

Why do I need a cookie banner on my website?

Developers and website owners are concerned about the question: "Do I need a cookie banner?" The answer is yes, if the website:

  • Uses Yandex.Metrica, Google Analytics, Facebook Pixel or other trackers;
  • Offers access to your personal account, shopping cart, recommendations;
  • Collects forms, subscriptions, surveys, etc.

Legislation

In Russia, the collection of cookies, if they can identify the user, is regulated by FZ-152 "On Personal Data". The GDPR applies in the EU countries, while the CCPA and other local regulations apply in the USA. In all cases, it is required:

  • Obtaining informed consent;
  • Specifying a link to the privacy policy;
  • The possibility of rejecting or changing settings.

The best solution is a ready-made script from QForm

If you don't want to develop a notification from scratch, you can use the free solution from QForm, a universal and customizable cookie banner compatible with any CMS, including Bitrix.

Advantages:

  • Compatible with Bitrix templates (including the D7 core).
  • It is embedded in one line of code.
  • Legally correct text and design.
  • Without plugins and registration.
  • Free and reliable.

How to embed a cookie script in Bitrix

Step 1. Find the file footer.php your template

In the Bitrix admin panel:

  1. Go to Content → Site Structure.
  2. Open the template, usually the path:
     /bitrix/templates/название_шаблона/footer.php
  3. Insert the script before the </body> tag:

html

<script src="https://cdn.qform.io/cookie/cookie-banner.js" async></script>

This will ensure that the banner loads when any page is opened. Step 2. Customization (optional) To customize the appearance, texts, and behavior of the banner, add a configuration object before enabling the script.:

html

<script>
    window.qformCookieSettings = {
        backgroundColor: '#f0f0f0',
        buttonColor: '#007bff',
        fontColor: '#000',
        position: 'bottom',
        messageText: 'This website uses cookies to enhance user experience. For more information, see',
        policyText: 'Privacy Policy',
        privacyLink: '/privacy-policy/',
        cookieExpiryDays: 60
    };
</script>
<script src="https://cdn.qform.io/cookie/cookie-banner.js" async></script>

Support for various templates and websites on Bitrix

The 1C-Bitrix platform supports multisite, custom templates, and includeArea. Depending on the architecture, the script can be added to:

/bitrix/templates/шаблон/footer.php

or to the included area if the footer is connected via

<?$APPLICATION->IncludeFile();?>

In a multi-site structure, insert a script into each template where a banner is required.

Testing

After adding the script:

  1. Open the website in incognito mode.
  2. Make sure that the banner is loading correctly.
  3. Check the policy link.
  4. Accept the agreement and reload, the banner should disappear for a set number of days.

Useful configuration options

Parameter

Appointment

backgroundColor

Banner background color

buttonColor

The color of the consent button

fontColor

Text color

messageText

Notification text

policyText

The text of the link to the policy

privacyLink

Link to the Privacy Policy

position

Banner location (top, bottom, etc.)

cookieExpiryDays

Consent retention period, in days

How a cookie banner affects SEO and user behavior

  • It has a positive effect on ranking — Google takes into account the transparency of data handling.
  • Improves the user experience — a minimalistic banner does not annoy the user.
  • Increases trust, which is especially important for online stores and corporate websites.

Conclusion

Cookie notification is a mandatory element of a legally clean website, especially if you work on the 1C-Bitrix platform, where data collection and analytics are often used.

Advantages of the QForm script:

  • Ease of implementation;
  • Legal correctness;
  • Flexible settings;
  • Compatible with any Bitrix template.

Add it today, and your site will become not only legitimate, but also more professional in terms of UX and SEO.