added piwik and ga options to mobile layout
This commit is contained in:
parent
eecf1d5d82
commit
80117d8ab6
1 changed files with 23 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue