Created
September 10, 2015 09:55
-
-
Save kevinruscoe/69ab1924e5f268742fd0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
/** | |
* Set's a 'do-not-track' cookie that'll expire in 10 years, used in conjunction with Google Tag Manager | |
* | |
* @return void | |
* @author Kevin Ruscoe | |
*/ | |
function setDoNotTrackCookie(){ | |
setcookie('do-not-track', 'do-not-track', strtotime( '+10 years' )); | |
} | |
if(isset($_GET['dnt'])){ setDoNotTrackCookie(); } | |
?> | |
<!-- Google Tag Manager --> | |
... your tag manager code | |
<!-- End Google Tag Manager --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment