CookieLegit documentation

CookieLegit is a WordPress plugin that helps you set up a GDPR-compliant cookie notice in minutes with minimal effort all from within your WordPress Admin. On this page, you can find information on installing the plugin, customizing your cookie notice, adding tracking codes, configuring additional settings, and integrating with Google Tag Manager for optimal compliance.

CookieLegit has been tested with:

  • WordPress 6.7.2
  • PHP 8.0

Installing CookieLegit

CookieLegit can be installed in three ways:

  1. From the WordPress repository via your WordPress Admin
  2. By uploading the plugin directly in your WordPress Admin
  3. Using FTP

While multiple installation methods are available, we strongly recommend installing CookieLegit from the WordPress repository through your WordPress Admin, as it is the easiest and least prone to errors.

Install from the WordPress repository

Again, this is the recommended way to install CookieLegit.

First, log in to your WordPress website. Once logged in, navigate to Plugins > Add New from the left-side menu.

On the “Add Plugins” page, use the search bar to look for “CookieLegit.” Our plugin should appear as the top result. Look for the following:

CookieLegit Plugin Search Result

Click the “Install Now” button. After a few seconds, the button will change to “Activate.” Click “Activate” to enable the plugin.

You’re now ready to customize your cookie notice and add your tracking codes!

Direct upload from your WordPress admin

To install the plugin this way, you first need to download it from the official plugin page on
WordPress.org.

Once the plugin is downloaded, log in to your WordPress website and navigate to Plugins > Add New.

On this page, instead of searching for the plugin, click the Upload Plugin button at the top. Here, you can upload the ZIP file you downloaded from WordPress.org.

After uploading, you will be redirected to a page where you can activate the plugin. Once activated, you can start customizing your cookie notice and adding your tracking codes!

Install through FTP

To install the plugin this way, first download it from the official plugin page on
WordPress.org.

Once downloaded, connect to your website using your preferred FTP client.

Navigate to [your site root]/wp-content/plugins.

Before uploading the plugin, make sure to unzip the downloaded file.

After uploading the extracted folder, log in to your WordPress site and go to
Plugins > Installed Plugins. Locate CookieLegit, then click Activate.

That’s it! Your plugin is now installed and ready to use.

Plugin Settings

CookieLegit provides explanations for all settings within the plugin, so we won’t go over every detail here.

However, it’s important to know that the settings are divided into four tabs:

  1. Notice Settings
    These settings control the appearance of your cookie notice. You can customize colors, the displayed text, and whether users can opt in to different types of cookies.
  2. Pixel Settings
    Here, you can add tracking pixels for Google Tag Manager, Google Analytics, LinkedIn, and Meta. You can also enable Consent Mode and toggle the use of our Google Tag. (More about the Google Tag)
  3. Blocking
    This tab allows you to block elements such as iFrames and scripts that are loaded through WordPress hooks.
  4. Additional
    Currently, this tab includes an option to “Give us some love.” Enabling this will display our logo in your cookie banner. It’s not required, but we’d really appreciate it!

Using the CookieLegit Google Tag

We’re working hard to get our tag into the Google Tag template galery, so these docs might change.

Configure the Tag

At CookieLegit, we like to keep things simple. That’s why we’ve kept our Google Tag lightweight, ensuring a straightforward setup.

After adding our tag to Google Tag Manager, we recommend adding at least one row to the Default Consent Settings.

To do this, click the “Add row” button beneath the Default Consent Settings table. While you are free to configure consent settings as needed, we recommend the following setup for optimal compliance:

  • Analytical cookiesDisabled
  • Advertising cookiesDisabled
  • Functional cookiesEnabled
  • Regionall

This configuration ensures compliance with all regions that have cookie laws. Your settings should look like this:

Google Tag Manager Consent Settings

Although our tag is designed to pass these settings through automatically, it’s best to set them manually as well for extra assurance.

Add settings for different regions

While adding a row for all regions is a great default, you may want to set different consent settings for regions with specific rules.

To do this, start by adding a new row and set the region to something more specific, such as US or NL. This will apply your default settings to only those regions. You can add multiple regions by separating them with a comma, for example: FR, NL, BE.

For certain regions, you can even specify more granular locations. For instance, to set consent settings for California, use US-CA.

You can add as many rows as needed for different regions. If two regions conflict (for example, US and US-CA), the more specific region (in this case, US-CA) will take precedence.

Consent initialization

For the tag to work in a propper way, configure its trigger to Consent Initialization – All Pages.

If you use any other trigger for the CookieLegit Tag it won’t function propperly.

Trigger other tags

Although most tags will function properly with the default settings, some custom tags without built-in consent checks may not work correctly initially. These tags will need an additional trigger, alongside the All Pages trigger, to ensure they load when a user visits your website for the first time.

CookieLegit emits an event every time the consent settings are updated by a user. To make full use of this, we recommend creating a custom event trigger so that all tags are properly updated. Follow the steps below to set it up:

  1. Pick a tag that doesn’t have default consent checks.
  2. Under triggers, add a new one.
  3. In the “Choose a trigger” screen, click on the plug icon.
  4. Now you’re in the trigger configuration. Add a trigger type of “Custom Event.”
  5. For the event name, enter CookieLegitConsentUpdated.
  6. Give it an appropriate name, such as CookieLegit Consent Update, and save it.
  7. Save your tag, and you’re done!
  8. You can now add this trigger to other tags as needed. The above steps only need to be completed once per account.

Adding this trigger to tags that need it ensures they are loaded correctly for users who have not yet set their cookie preferences.