Turn on consent mode so the Leadfeeder tracking script sets its cookie only after a visitor grants consent.
The Leadfeeder 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.
To learn what the tracking script collects, see What is the Leadfeeder tracking script?
Before you start: You need the tracking script installed through Google Tag Manager (or another tag manager) and your consent management platform set up in the same container.
How to add the tracking script to your CMP
We don't recommend blocking the entire tracking script until the visitor grants consent. If the script is blocked completely until consent is granted, and most of your visitors don't grant consent, Leadfeeder will identify significantly fewer companies than actually visit your website.
Instead, you can configure the tracking script 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 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 Google Tag Manager:
Use the correct GTM container. If you already have a consent management platform (such as CookieHub or OneTrust) in Google Tag Manager, make sure it's in the same container as the tracking script. Set the tracking script to trigger on all pages. It won't set cookies until it receives the consent event in the next step.
Configure the consent event. Create a new Custom HTML tag for accepting the Leadfeeder cookie and add this code:
<script>
if (window.ldfdr) {
window.ldfdr.acceptCookie()
}
</script>
This consent event tells the tracking script to set its cookie once the visitor grants consent. In GTM, it looks like this:
Choose a trigger. Choose a trigger from your consent management platform's sample triggers. For example, with CookieHub, choose CookieHub - Allowed Analytics.
Publish. Save, submit and publish your changes.
Turn on consent mode. In Leadfeeder, go to Settings > Company > Website Tracker and turn on consent mode on the Cookie settings tab.
If you skip step 5, the tracking script keeps setting cookies for every visitor.
Once you've finished these steps, the Leadfeeder cookie is only set for visitors who grant cookie consent. For visitors who don't, the tracking script doesn't set cookies.
Without cookies, the tracking script still identifies the companies visiting your website, but it can't recognize returning visitors. Leadfeeder may show someone as a new visitor even if they've visited before. See What are the numbers by each visit?
What if I don't use Google Tag Manager?
Set up a similar process in the tag manager you use, or ask your technical team to set one up. As soon as the tracking script receives the consent event from step 2, it sets the cookie.
Based on advice from your legal team, you can also anonymise IP addresses on the Advanced tracking tab in Settings > Company > Website Tracker.
--
Questions, comments or feedback? Contact our support team via chat or email us at support@leadfeeder.com.
