Video

A video does not yet exist for this guide.

Request Video

Contents

Before You Begin

Download the Cookie Consent ZIP file from your Zomex account and extract it on your computer. The script contains one CSS file and one JavaScript file:

  • cookieconsent.css
  • cookieconsent.js

The script is built with native JavaScript and does not require jQuery, external images or any other libraries.

Before installing it, make sure your website has a Privacy Policy page. You will add the URL of that page to the script settings after uploading the files.

Generic Website Installation

Use these instructions for a static HTML website, a custom PHP website or another website where you can edit the page template directly.

1) Upload cookieconsent.css to your website's CSS directory and cookieconsent.js to its JavaScript directory.

2) Add the following code before the closing </head> tag. Update the file paths if you uploaded the files somewhere else:

<link rel="stylesheet" href="/css/cookieconsent.css">
<script src="/js/cookieconsent.js" defer></script>

The defer attribute allows the JavaScript file to load without delaying the page content. No additional HTML is required because the notice is generated automatically.

WHMCS Installation

1) Upload cookieconsent.css to the CSS directory and cookieconsent.js to the JavaScript directory of your active WHMCS template.

For example:

  • templates/your-template/css/cookieconsent.css
  • templates/your-template/js/cookieconsent.js

2) Open header.tpl from your active template and add the following code before the closing </head> tag:

<link rel="stylesheet" href="{$WEB_ROOT}/templates/{$template}/css/cookieconsent.css">
<script src="{$WEB_ROOT}/templates/{$template}/js/cookieconsent.js" defer></script>

3) Save the file and clear the WHMCS template cache before testing the notice.

The script does not use jQuery, so there is no JavaScript dependency to add to the WHMCS template.

WordPress Installation

We recommend adding the files to an active child theme so they are not removed when the parent theme is updated.

1) Upload the files to the following directories inside your child theme:

  • wp-content/themes/your-child-theme/css/cookieconsent.css
  • wp-content/themes/your-child-theme/js/cookieconsent.js

2) Open the child theme's functions.php file and add the following:

function zomex_cookie_consent_assets() {

	wp_enqueue_style(
		'zomex-cookie-consent',
		get_stylesheet_directory_uri() . '/css/cookieconsent.css',
		array(),
		'3.6'
	);

	wp_enqueue_script(
		'zomex-cookie-consent',
		get_stylesheet_directory_uri() . '/js/cookieconsent.js',
		array(),
		'3.6',
		true
	);

}
add_action('wp_enqueue_scripts', 'zomex_cookie_consent_assets');

This loads the stylesheet normally and places the JavaScript file in the footer. The empty dependency array confirms that jQuery is not required.

3) Save the file and clear any WordPress, server or CDN cache before testing the notice.

Now you have installed the Cookie Consent you should now configure it. View Guide

Request Support

We hope you found this documentation useful. If you run into any issues we will be happy to assist you.