summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanix <danix@danix.xyz>2018-07-26 22:00:56 +0200
committerdanix <danix@danix.xyz>2018-07-26 22:00:56 +0200
commitb4113a8ec00f7083e8ec582daf32d8ea31260fda (patch)
treeec1456079b3e6d55840fe2a6e18e01d61e16cd68
parent0b37291cb093b12307582fe0a110732fb8917fb8 (diff)
downloaddanixland-site-plugin-b4113a8ec00f7083e8ec582daf32d8ea31260fda.tar.gz
danixland-site-plugin-b4113a8ec00f7083e8ec582daf32d8ea31260fda.zip
surrounded google analytics code with cookie-notice code to block it if the user doesn't accept our cookie policy
-rw-r--r--danixland-site-plugin.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/danixland-site-plugin.php b/danixland-site-plugin.php
index 0245d55..6db6576 100644
--- a/danixland-site-plugin.php
+++ b/danixland-site-plugin.php
@@ -2,6 +2,10 @@
/*
Plugin Name: Site Plugin for danix.xyz
Description: Site specific code changes for danix.xyz
+Plugin URI: https://danix.xyz
+Version: 0.7
+Author: Danilo 'danix' Macri
+Author URI: https://danix.xyz
*/
/**
@@ -74,7 +78,8 @@ add_shortcode('download', 'danix_download_button');
* The google analytics code
*
*/
-function danix_google_anal() {?>
+function danix_google_anal() {
+ if ( function_exists('cn_cookies_accepted') && cn_cookies_accepted() ) { ?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-23882460-1"></script>
<script>
@@ -85,6 +90,7 @@ function danix_google_anal() {?>
gtag('config', 'UA-23882460-1');
</script>
<?php }
+}
add_action('wp_head', 'danix_google_anal', 10);
/**