Video

A video does not yet exist for this guide.

Request Video

Contents

First download the cookie law ZIP file from inside your Zomex account. Extract the files and move the extracted folder to your desktop.

Next check to see if your website loads jQuery, you can do this by viewing your website and then right click somewhere blank on the page > click on view source or view page source. Then search for jquery between <head> & </head>. If you see it skip this step, if not add the following just below <head>:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>

Next select the type of website you're installing the script on:

HTML

1) Open the EU Cookie Law Script folder and then files, upload the images, js & css directories to the public_html/ directory of your web hosting account.

2) Open each of your pages and add the following code just before </head>:

<link href="css/eucookielaw.css" type="text/css" rel="stylesheet" />
<script src="javascript/eucookielaw.js"></script>

WHMCS

1) Open the EU Cookie Law Script folder and then files, upload the images, js & css directories to your active WHMCS template directory. e.g public_html/templates/prosper/

2) Open header.tpl of your activate template directory and add the following just before </head>:

<link href="templates/{$template}/css/eucookielaw.css" type="text/css" rel="stylesheet" />
<script src="templates/{$template}/javascript/eucookielaw.js"></script>

Wordpress

1) Open the EU Cookie Law Script folder and then files, upload the images, js & css directories to your active WordPress theme directory. e.g public_html/wp-content/themes/glaze/

2) Open header.php of your activate template directory and add the following just before </head>:

<link href="<?php bloginfo('template_directory'); ?>/css/eucookielaw.css" type="text/css" rel="stylesheet" />
<script src="<?php bloginfo('template_directory'); ?>/javascript/eucookielaw.js"></script>

Setting your privacy policy URL

Open the javascript/eucookielaw.js file and change replace Zomex Privacy Policy URL with your own:

https://www.zomex.com/legal/privacy-policy/

The script also supports the ability to load your websites cookies only if/when the close button1 is clicked by your visitor. This is done by wrapping your cookie generating Javascript (e.g Google Analytics code) is our PHP statement.

Add the following code below the two lines you just pasted when installing the script:

<?php if(isset($_COOKIE['eucookie'])){ ?>
<?php } ?>

Add your cookie generating code between these two lines and it'll only load when your visitors accept the cookie notice by clicking the close button.

Code examples

Here is a example using Google Analytics:

<?php if(isset($_COOKIE['eucookie'])){ ?>
	<script type="text/javascript">
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
<?php } ?>

If you're using a WHMCS template the code must be modified slightly:

{php} if(isset($_COOKIE['eucookie'])){ {/php}
	{literal}
	<script type="text/javascript">
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
	{/literal}
{php} } {/php}

Request Support

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