Help Center
Cookie banners causing leads to be categorised as Direct Traffic
This article is intended only as technical advice and not as legal advice. We recommend seeking legal advice before deciding whether it is appropriate to run the Attributer code on your website without explicit cookie consent. For more on this, read this article.
If you’ve noticed a spike in leads coming through as Direct Traffic, even though you know those visitors actually came from Google, Facebook, an email campaign, etc, the most common cause is that a cookie consent tool on your website (such as CookieYes, CookieBot, or similar) is deleting the Attributer cookie after it’s been set.
This article explains why that happens and how to fix it.
Why this is happening
Cookie consent tools work by scanning your site for any cookies that get set, and then deleting any cookies that were set before the visitor gave consent. The idea is that nothing gets retained until the visitor explicitly opts in.
The problem is that this interferes with how Attributer captures attribution data. Here’s what’s going on under the hood:
- A visitor lands on your site from an organic Google search (or wherever).
- Attributer runs on that first page load, sees that the referrer is
www.google.com, categorises it correctly as Organic Search, and stores that data in a cookie calledflaretrk. - The visitor either accepts, rejects, or just ignores the cookie banner and clicks through to a second page on your site.
- The cookie consent tool sees that the
flaretrkcookie was set before consent was given and deletes it. - Attributer runs again on the second page, doesn’t find an existing cookie, and assumes this is a brand new visitor. It tries to set the cookie again.
- But this time, the referrer isn’t
www.google.comanymore. The referrer is your own website (because the visitor clicked from page one to page two). When the referrer is your own domain, Attributer categorises it as Direct Traffic. - That Direct Traffic data is what gets passed through when the visitor eventually submits a form.
This is why you usually see a high amount of leads coming from Direct Traffic, but not all. Anyone who lands on a page with a form and submits it before navigating to another page will still come through with the correct attribution. It’s only the visitors who click around the site before submitting that get reset to Direct Traffic.
How to fix it
The fix is to tell your cookie consent tool that the Attributer cookie is allowed to run, so that it doesn’t delete it after the first page load.
Each cookie consent tool has its own way of doing this. We’ve written specific guides for the most common ones:
If you’re using a different cookie consent tool, the process is generally the same: you need to add the flaretrk cookie (or the Attributer script URL https://d1b3llzbo1rqxo.cloudfront.net/attributer.js) to the list of allowed/necessary cookies in your consent tool’s settings. If you’re not sure how to do that, reach out to us and we can help.
How to verify the fix is working
Once you’ve made the change, you’ll want to test that it’s actually working. Here’s how:
Step 1: Open a new incognito window
Make sure you don’t have any other incognito windows open in the background. Cookies are only cleared from incognito windows when all incognito windows are closed, so if you’ve got an old one open, you may have a stale Attributer cookie sitting there that gives you misleading results.
Step 2: Visit your site from a real source
In the new incognito window, visit your site from somewhere that isn’t direct traffic. For example, do a Google search for your business and click through, or paste a URL with UTM parameters on the end (something like https://yourwebsite.com/?utm_source=test&utm_medium=test).
Step 3: Check what’s in the cookie
Before you interact with the cookie banner, open the browser console (right click anywhere on the page > Inspect > Console tab) and paste in:
document.FlareTrk.data;
This will show you what Attributer has currently stored. You should see the correct channel (Organic Search, or whatever source you came from). If you see this, great — Attributer captured the first visit correctly.
Step 4: Interact with the cookie banner
Accept (or reject, or customise) the cookie banner.
Step 5: Navigate to another page on your site
Click through to a different page on your site (any internal link will do).
Step 6: Check the cookie again
Run document.FlareTrk.data; in the console again on this second page.
- If the data is still showing the correct channel from your first visit (e.g. Organic Search), then everything is working correctly. The cookie has been preserved through the consent interaction.
- If the data has changed to Direct Traffic on the second page, then the cookie is still being deleted by your consent tool and there’s a further issue to look into. Let us know and we’ll dig in.
Need a hand?
If you’ve followed the steps above and you’re still seeing leads come through as Direct Traffic when they shouldn’t be, reach out to us via the contact form and we’ll take a look.
Can't find the answer you need? Contact us!
Our team are available to answer any questions you have