added piwik and ga options to mobile layout

This commit is contained in:
danielvincent 2011-02-08 17:39:41 -08:00
parent eecf1d5d82
commit 80117d8ab6

View file

@ -30,6 +30,29 @@
= yield(:head)
-if AppConfig[:google_a_site]
:javascript
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '#{AppConfig[:google_a_site]}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
-if AppConfig[:piwik_id]
:javascript
var pkBaseURL = (("https:" == document.location.protocol) ? "https://#{AppConfig[:piwik_url]}/" : "http://#{AppConfig[:piwik_url]}/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", #{AppConfig[:piwik_id]});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
%body
#content{:data => {:role => 'page'}}
#header