Skip to main content

Configuring the Web Visitors Tracking Script with Your Consent Management Platform (CMP)

This article helps you configure the Web Visitors tracking script to work with your cookie banner or Consent Management Platform (CMP).

Written by Ruthie Keith

The Web Visitors tracking script works with or without cookies, and can be configured to work with most Consent Management Platforms (CMPs). When configured this way, the tracking script sets its cookie only once a visitor grants consent. If a visitor does not grant consent, the tracking script does not set a cookie, but it will still identify the company visiting your site. Without a cookie it simply won't recognize that visitor as a returning visitor across sessions. How you configure consent for your site, and whether your use case requires visitor consent under applicable law, is your organization's decision to make.

If you would like to understand in more detail how the Web Visitors tracking script works and what data it collects, you can read about it here.

How to add the Web Visitors tracking script in your CMP

If you are using a CMP, we don’t recommend blocking the entire Web Visitors tracking script until the visitor grants consent. If the script is blocked completely until consent is granted, and if most of your visitors don’t grant consent, the companies identified on your website by Web Visitors will be significantly fewer than the actual number. This means you will not be using Web Visitors to get the most value out of it.

Instead, you can configure Web Visitors with your CMP in a way that reflects the cookie and consent approach your organization has chosen for your site.

To set this up, you will need to:

  • Enable Consent Mode of the Web Visitors tracking script (in Settings > Company > Website Tracker, on the Cookie settings tab)

  • Add the tracking script in your CMP under the category of “Analytical cookies”

  • Configure consent events: trigger a JS request to the tracking script when consent is granted

  • Once the tracking script receives the consent event, it will set the cookie

The easiest way to set this up is in the Google Tag Manager and the steps are as follows:

STEP 1: Ensure you are using the correct GTM container

If you already have a cookie consent management platform set up in your Google Tag Manager container (for example CookieHub, OneTrust, etc.), please make sure that it is in the same GTM container you have connected to your website where the Web Visitors tracking script is. Please make sure that the Web Visitors tracking script is installed to trigger on all pages. It won't set cookies until we specifically instruct it to (which is done in the next step).

STEP 2: Configure Consent Event

Set up a new custom HTML tag for accepting the Leadfeeder cookie and include the following code there:

<script>
if (window.ldfdr) {
window.ldfdr.acceptCookie()
}
</script>

This is the consent event that instructs the tracking script to set the cookie once consent has been granted. In GTM, it should look like this:

STEP 3: Choose a trigger

Choose a trigger from your cookie consent management platform sample triggers. For example, if you use CookieHub, you can choose CookieHub - Allowed Analytics.

STEP 4: Publish

Save, submit changes, and publish.

STEP 5: Enable Consent Management Mode

Enable the consent management mode of the Web Visitors tracking script in Settings > Company > Website Tracker, on the Cookie settings tab. This step is very important as if this mode is not enabled, the tracking script will still always set cookies.

Once the above steps are finished, only the visitors that grant cookie consent on your website will have the Leadfeeder cookie set in their browser. For visitors that do not grant cookie consent, the tracking script will not set cookies.

When cookies are disabled, the Web Visitors tracking script will still identify companies visiting your website. However, it won’t be able to recognise individual visitors on your website as returning (repeat) visitors. That means that each visitor might be shown as a new visitor in the Web Visitors UI even if they might have visited your website before. You can read more about the sessions and returning visitors here.

What if I don’t use GTM?

If you don’t use GTM, you can also set up a process similar to the one explained above in the tag management system you currently use. If you don’t use any tag management system, you can reach out to your technical team to set up a similar process. As soon as the tracking script receives the consent event (in step 2), it will set the cookie and you are all set.

On top of the above-mentioned process, based on advice from your legal team, you can also anonymise the IP addresses in Settings > Company > Website Tracker, on the Advanced tracking tab.

--

Questions, comments, feedback? Please let us know by contacting our support team via the chat or by sending us an email at support@leadfeeder.com.

RELATED:

Did this answer your question?