Files
Testing/tbb/wp-content/plugins/google-analytics-dashboard-for-wp/front/views/analytics-optout-code.php
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

29 lines
995 B
PHP

<?php
/**
* Author: ExactMetrics team
* Copyright 2018 ExactMetrics team
* Author URI: https://exactmetrics.com
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
?>
<script>
var gadwpDnt = false;
var gadwpProperty = '<?php echo $data['uaid']?>';
var gadwpDntFollow = <?php echo $data['gaDntOptout'] ? 'true' : 'false'?>;
var gadwpOptout = <?php echo $data['gaOptout'] ? 'true' : 'false'?>;
var disableStr = 'ga-disable-' + gadwpProperty;
if(gadwpDntFollow && (window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1")) {
gadwpDnt = true;
}
if (gadwpDnt || (document.cookie.indexOf(disableStr + '=true') > -1 && gadwpOptout)) {
window[disableStr] = true;
}
function gaOptout() {
var expDate = new Date;
expDate.setFullYear(expDate.getFullYear( ) + 10);
document.cookie = disableStr + '=true; expires=' + expDate.toGMTString( ) + '; path=/';
window[disableStr] = true;
}
</script>