Skip to content
This repository was archived by the owner on Aug 21, 2019. It is now read-only.

Commit 3e2138f

Browse files
committed
critical bugfix GA snippet
plus another case meta content-type Signed-off-by: Bruno Meilick <b@bnomei.com>
1 parent 95877a3 commit 3e2138f

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

kirby-htmlhead.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function($page, $title = null) {
6262
'<meta charset="utf-8">',
6363
'<meta http-equiv="x-ua-compatible" content="ie=edge">',
6464
'<meta name="viewport" content="width=device-width, initial-scale=1">',
65-
'<meta http-equiv="content-type" content="text/html; charset=utf-8" />',
65+
// '<meta http-equiv="content-type" content="text/html; charset=utf-8" />',
6666
'<base href="'.site()->url().'">',
6767
];
6868

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "kirby-htmlhead",
33
"description": "Kirby Page Method to add code into the HTML Head using snippets",
4-
"version": "0.5.2",
4+
"version": "0.6.0",
55
"type": "kirby-plugin",
66
"license": "MIT",
77
"author": "Bruno Meilick"

snippets/htmlhead-googleanalytics.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
<?php
1+
<?php
22
$htmlhead_googleanalytics = c::get('plugin.htmlhead.googleanalytics', 'UA-');
33
$htmlhead_googleanalytics_anonymizeIp = c::get('plugin.htmlhead.googleanalytics.anonymizeIp', true);
44

5-
if(!KirbyHTMLHead::is_localhost() && strlen($gakey) > strlen("UA-") ): ?>
6-
<!-- Google Analytics -->
5+
if(!KirbyHTMLHead::is_localhost() && strlen($htmlhead_googleanalytics) > strlen("UA-") ): ?>
76
<script type="text/javascript">
8-
var gaProperty = '<?php echo $gakey ?>';
7+
var gaProperty = '<?php echo $htmlhead_googleanalytics ?>';
98
var disableStr = 'ga-disable-' + gaProperty;
109
if (document.cookie.indexOf(disableStr + '=true') > -1) { window[disableStr] = true;
1110
}
@@ -18,10 +17,10 @@ function gaOptout() {
1817
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
1918
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
2019
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
21-
ga('create', '<?php echo $gakey ?>', 'auto');
20+
ga('create', '<?php echo $htmlhead_googleanalytics ?>', 'auto');
2221
<?php if($htmlhead_googleanalytics_anonymizeIp): ?>
2322
ga('set', 'anonymizeIp', true);
2423
<?php endif; ?>
2524
ga('send', 'pageview');
2625
</script>
27-
<?php endif; ?>
26+
<?php endif; ?>

0 commit comments

Comments
 (0)