Permalink
Browse files

Added configuration variable for Google Analytics

  • Loading branch information...
1 parent 9502d81 commit 90f3b9c56b2e657974e2550b1c8d386aafbc92f7 @tsak committed Sep 12, 2011
Showing with 16 additions and 12 deletions.
  1. +4 −1 SETUP
  2. +4 −1 app/config/core.sample.php
  3. +8 −10 app/views/layouts/default.tpl
View
5 SETUP
@@ -18,12 +18,15 @@ SETUP
Line 209: Configure::write('Security.cipherSeed', '');
Add a random 29 digit number
- Line 322-EOF: Obtain an API Key from http://api.glitch.com/keys/new/ and fill the blanks
+ Line 322-325: Obtain an API Key from http://api.glitch.com/keys/new/ and fill the blanks
Configure::write('Glitch.api', array(
'key' => '',
'secret' => '',
));
+ (Optional) Line 328: Uncomment and add a Google Analytics account number
+ Configure::write('GoogleAnalytics.account_number', '');
+
5. Deploy somewhere in your webroot
6. Make sure app/tmp is writable
View
5 app/config/core.sample.php
@@ -322,4 +322,7 @@
Configure::write('Glitch.api', array(
'key' => '',
'secret' => '',
- ));
+ ));
+
+ // Optional - Google Analytics
+ // Configure::write('GoogleAnalytics.account_number', '');
View
18 app/views/layouts/default.tpl
@@ -65,18 +65,16 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.6.2.min.js"><\/script>')</script>
-{*
-<script src="js/script.js"></script>
-*}
-
{$javascript->link('script')}
-{*<script>*}
-{* var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']]; // Change UA-XXXXX-X to be your site's ID*}
-{* (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;*}
-{* g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';*}
-{* s.parentNode.insertBefore(g,s)}(document,'script'));*}
-{*</script>*}
+{if Configure::read('GoogleAnalytics.account_number')}
+<script>
+ var _gaq=[['_setAccount','{Configure::read('GoogleAnalytics.account_number')}'],['_trackPageview']];
+ (function(d,t){ var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
+ g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
+ s.parentNode.insertBefore(g,s) }(document,'script'));
+</script>
+{/if}
<!--[if lt IE 7 ]>{literal}
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"></script>

0 comments on commit 90f3b9c

Please sign in to comment.