Skip to content

Scan your website for cookies


In development

After configuring your property, it’s time to scan your website for cookies.

If you’re using an analytical tool like Google Analytics, it’s important to set up an internal filter before scanning to exclude Cookifi scanner traffic.

This can be done via Google Tag Manager (GTM) or directly in your gtag.js implementation, depending on how you’ve set up your analytics.

In this example, we’ll walk through excluding Cookifi scanner traffic from Google Analytics (GA4).

  1. Go to Variables.
  2. Create a new URL type variable. Select Query as the component type, and enter traffic_type as the query key: Cookifi - GTM - traffic_type
variable
  3. Click Format value and check Convert undefined to: Cookifi - GTM - traffic_type format
value
  4. Click the + icon: Cookifi - GTM - traffic_type convert undefined
to
  5. Click the + icon again: Cookifi - GTM - traffic_type choose a
variable
  6. Within Variable Configuration, click anywhere to choose a variable type. Scroll down and select the Undefined value variable: Cookifi - GTM - traffic_type undefined
variable
  7. Save the URL type variable.
  8. Open the Google Tag for GA4. In Configuration settings, add a new parameter traffic_type. For the value, insert the URL variable created above: Cookifi - GTM - traffic_type Google Tag
update

Voilà - you’re done and can jump to create an internal filter in GA4

If GA4 is implemented directly in your codebase, replace your existing script with the following:

Modified GA4 Config Script
<!-- Google tag (gtag.js) -->
<script async src='https://www.googletagmanager.com/gtag/js?id=G-xxxxxxxxx'></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
function getTrafficType() {
const urlParams = new URLSearchParams(window.location.search);
const trafficType = urlParams.get('traffic_type');
return trafficType ? trafficType : undefined;
}
gtag('config', 'G-xxxxxxxxx', {
'traffic_type': getTrafficType()
});
</script>

Make sure to replace the G-xxxxxxxxx placeholders on line #2 and #14 with your actual GA4 measurement ID.

Once GA4 is receiving the traffic_type parameter, you need to filter out scanner traffic:

  1. In GA4, navigate to Admin > Data collection and modification > Data filters: Cookifi - GA4 - data filters
  2. Click Create filter and select Internal traffic: Cookifi - GA4 - data filters
  3. Enter a name for the filter (e.g., Cookifi scanner), and cookifi for the parameter value: Cookifi - add a GA4 internal filter Make sure to activate the filter by selecting the Active filter state.

In development

In the Cookifi admin panel, navigate to Scans and click Add:

Cookifi scans - add new scan

Select the property you wish to scan. Note a valid sitemap needs to be associated with a property.

Click Run.

After scanning, Cookifi will categorise detected cookies into the appropriate categories.

You can review and modify them in the Cookies settings of your property.

The scan frequency can be adjusted in Settings.