Created
September 15, 2015 18:10
-
-
Save jamescridland/a0783283b90550046f87 to your computer and use it in GitHub Desktop.
The easiest EU cookie solution code ever?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Put this just under your <HEAD> in HTML. | |
Note - it displays once, and once only. | |
It requires you to run Google Analytics on your website. | |
If a user deletes their cookies, it'll appear again. | |
You can test it by going into Incognito Mode. | |
--> | |
<script type='text/javascript'> | |
if (document.cookie.indexOf('_ga') == -1) { | |
document.write("<div style='width:100%; background-color:#d5e8f3;padding:10px;'>We use cookies to personalise content and ads and to improve your browsing experience. We share limited data with our advertising and analytics partners to help us run our business better.<a href='/cookies'>Find out more about our cookies</a></div>"); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment