From 8dd42948e5bd0aa2f31b9a5e08289aaca8607b1d Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 11:35:46 +0700 Subject: [PATCH 01/10] Added Google Universal Analytics Added Google Universal Analytics --- system/config.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/config.ini b/system/config.ini index 8ac10b6..1c95e03 100644 --- a/system/config.ini +++ b/system/config.ini @@ -26,6 +26,9 @@ disqus.shortname = "" ; Google publisher google.publisher = "" +; Google analytics +google.analytics.js = "" + ; Pagination, RSS, and JSON posts.perpage = "5" tag.perpage = "10" From efd0d5f5f50d61b53733b6a0fc1a93952a48857b Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 11:37:15 +0700 Subject: [PATCH 02/10] Added Function Google Analytics --- system/includes/functions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/system/includes/functions.php b/system/includes/functions.php index 4b59824..1c307f2 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -600,6 +600,13 @@ function publisher(){ } } +function analytics(){ + $analytics = config('google.analytics.js'); + if (!empty($analytics)) { + return $analytics; + } +} + // Menu function menu(){ $menu = config('blog.menu'); @@ -641,4 +648,4 @@ function generate_rss($posts){ // Turn an array of posts into a JSON function generate_json($posts){ return json_encode($posts); -} \ No newline at end of file +} From 51866dcfa2c232676e463c27031d923082202a3d Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 11:38:34 +0700 Subject: [PATCH 03/10] Add Class Hide --- themes/default/css/style.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/default/css/style.css b/themes/default/css/style.css index c1c78db..3400d6e 100644 --- a/themes/default/css/style.css +++ b/themes/default/css/style.css @@ -41,6 +41,11 @@ img { outline: 0 none; } +.hide { + position: absolute; + top: -9999em; + left: -9999em; +} /*---------------------------- Headings -----------------------------*/ @@ -622,4 +627,4 @@ aside .copyright p{ width: 100%; } -} \ No newline at end of file +} From 9867846e03c2f35aa0f70f6f226ff231591d603b Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 11:41:22 +0700 Subject: [PATCH 04/10] Add Google Analytics & Class Hide --- themes/default/layout.html.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/default/layout.html.php b/themes/default/layout.html.php index c363b47..83bd624 100644 --- a/themes/default/layout.html.php +++ b/themes/default/layout.html.php @@ -16,9 +16,12 @@ + -
+
@@ -41,4 +44,4 @@ - \ No newline at end of file + From d976116dd44d8fe02fe01e6715ad1ea839b8586e Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 15:42:30 +0700 Subject: [PATCH 05/10] Update Google Universal Analytics Function --- system/includes/functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/system/includes/functions.php b/system/includes/functions.php index 1c307f2..bc5469d 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -600,10 +600,16 @@ function publisher(){ } } +// Google Universal Analytics function analytics(){ $analytics = config('google.analytics.js'); + $script = <<(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); +ga('create', '{$analytics}'); +ga('send', 'pageview'); +EOF; if (!empty($analytics)) { - return $analytics; + return $script; } } From 216abe6200b79130ec4a252fbcce9a27eb32469b Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 15:44:22 +0700 Subject: [PATCH 06/10] Update Layout - Update Google Universal Analytics --- themes/default/layout.html.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/themes/default/layout.html.php b/themes/default/layout.html.php index 83bd624..739051b 100644 --- a/themes/default/layout.html.php +++ b/themes/default/layout.html.php @@ -16,9 +16,7 @@ - +
From 17f813f8519acd057ed6f843a85d601b37ae5cdc Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 16:31:24 +0700 Subject: [PATCH 07/10] Update Function / Update Script GA --- system/includes/functions.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/system/includes/functions.php b/system/includes/functions.php index bc5469d..7a5766b 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -600,13 +600,20 @@ function publisher(){ } } -// Google Universal Analytics +// Google Analytics function analytics(){ $analytics = config('google.analytics.js'); $script = <<(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); -ga('create', '{$analytics}'); -ga('send', 'pageview'); + EOF; if (!empty($analytics)) { return $script; From cf6cffd1d185201dfcabcdaa91e3406ccd4b21a5 Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 16:42:53 +0700 Subject: [PATCH 08/10] Update Layout / Move GA to Bottom --- themes/default/layout.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/layout.html.php b/themes/default/layout.html.php index 739051b..a3c5d20 100644 --- a/themes/default/layout.html.php +++ b/themes/default/layout.html.php @@ -16,7 +16,6 @@ -
@@ -41,5 +40,6 @@
+ From c4baa305fd1dde4014bd51efee368589828ab9d2 Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 16:48:22 +0700 Subject: [PATCH 09/10] Update Config --- system/config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/config.ini b/system/config.ini index 1c95e03..ecf1561 100644 --- a/system/config.ini +++ b/system/config.ini @@ -27,7 +27,7 @@ disqus.shortname = "" google.publisher = "" ; Google analytics -google.analytics.js = "" +google.analytics.id = "" ; Pagination, RSS, and JSON posts.perpage = "5" From 8777cbe9b3f81746801b5d3833c268467efa2d8b Mon Sep 17 00:00:00 2001 From: Mohamad Fahmi Date: Thu, 2 Jan 2014 16:49:37 +0700 Subject: [PATCH 10/10] Update Function --- system/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/includes/functions.php b/system/includes/functions.php index 7a5766b..864126e 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -602,7 +602,7 @@ function publisher(){ // Google Analytics function analytics(){ - $analytics = config('google.analytics.js'); + $analytics = config('google.analytics.id'); $script = << var _gaq = _gaq || [];