Troubleshooting - Implementing first-party cookies on your website

Enabling first-party cookies in your tracking script allows you to track your users more accurately. When first-party cookies are enabled, cookies are created on your website instead of Brevo or a third party.

Why use first-party cookies instead of third-party ones?

More and more major companies, such as Google, will stop using third-party cookies soon, and many browsers, like Safari or Firefox, already block them. This is all to protect users asking for greater privacy and control over how their data is used.

Indeed, a third-party cookie is a code that tracks information about a visitor’s browsing history across multiple websites. It is generated by a website other than your own and sends the tracked information to the third party who created the cookie, who often happens to be an advertiser.

In contrast, a first-party cookie is a code generated by default by a visitor’s computer when they visit your website. It is often used for user experience, as it can remember passwords, basic visitor data, and other preferences. It lets you monitor basic analytics, such as visitors' actions on your website or how often they visit it. However, it doesn’t allow you to see data related to your visitor's behavior on other websites you're not affiliated with.

How does it work?

Enabling first-party cookies adds the following parameter to the URLs redirecting to your website:

  • For marketing emails: _sc
  • For transactional emails: _se

In rare cases, this may cause issues with loading a page on your website if the application or web server doesn’t handle unknown parameters.

➡️ For example
  • Original URL: www.brevo.com
  • Modified URL:
    • For marketing emails: brevo.com?_sc=test_string
    • For transactional emails: brevo.com?_se=test_string

How to resolve potential issues?

Review the options below to resolve common issues that occur when implementing first-party cookies on your website.

Page Not Found

➡️ For example
brevo.com opens correctly but brevo.com?_sc=test_string or brevo.com?_se=test_string shows 404 error

If your page doesn’t show when the URL is clicked, you may need to confirm how your web server checks parameters. 

  1. If your web server expects a known set of parameters, add the following parameter:
    • For marketing emails: _sc
    • For transactional emails: _se
  2. If your web server evaluates query parameters to locate a resource, the server should skip evaluating the parameter. Configure your server settings to allow the following parameter:
    • For marketing emails: _sc
    • For transactional emails: _se

URL missing _se parameter

➡️ For example
brevo.com?_sc=test_string or brevo.com?_se=test_string will get changed to brevo.com only

When the first-party cookie setting is enabled, if your page URL is missing the "_sc" or "_se" parameter, you can check if any JavaScript script on your page is cleaning the URL or if there is a delayed application state in which the "_sc" or "_se" parameter is added back later. This happens quite often in Single Page Applications.

Your application clears the URL

➡️ For example
brevo.com?_sc=test_string or brevo.com?_se=test_string will get changed to brevo.com only

An application can be configured to read query parameters to determine states in a single-page or multi-page experience. It can clean its own URL to correctly represent the state it is in. 

  1. Your website framework should add "_sc" or "_se" as an exception and/or skip taking any action on it. Make sure the parameter persists in the URL until the tracking script has done its job.
  2. If your website clears and cleans unknown values from the address bar, make sure the Brevo tracking script calls happen as early as possible, ideally before loading any library. To help the tracking script calls happen quickly, we advise you place the Brevo tracking script as high in the website header as possible.

🤔 Have a question?

If you have a question, feel free to contact our support team by creating a ticket from your account. If you don't have an account yet, you can contact us here.

If you’re looking for help with a project using Brevo, we can match you with the right certified Brevo expert partner.

💬 Was this article helpful?

2 out of 8 found this helpful