diff options
-rw-r--r-- | notes/catalyst-master-merge-todos.txt | 2 | ||||
-rw-r--r-- | templates/web/default/tracking_code.html | 17 | ||||
-rw-r--r-- | templates/web/emptyhomes/tracking_code.html | 12 |
3 files changed, 28 insertions, 3 deletions
diff --git a/notes/catalyst-master-merge-todos.txt b/notes/catalyst-master-merge-todos.txt index 660d9ac93..44fba780e 100644 --- a/notes/catalyst-master-merge-todos.txt +++ b/notes/catalyst-master-merge-todos.txt @@ -5,5 +5,3 @@ convert templates for new micro sites (or switch old code to use new headers and should we ditch flickr import? (does not seem to be getting huge usage and those using it would probably report using another method: http://www.flickr.com/search/?w=all&q=fixmystreet&m=tags) add 'remember me on this computer' to auth login. What should default session lifetime be? - -tracking code diff --git a/templates/web/default/tracking_code.html b/templates/web/default/tracking_code.html index b287b8cfb..e5fc13793 100644 --- a/templates/web/default/tracking_code.html +++ b/templates/web/default/tracking_code.html @@ -1 +1,16 @@ -FIXME: insert tracking code here
\ No newline at end of file +[% IF c.config.BASE_URL == "http://www.fixmystreet.com" %] +<!-- Piwik --> +<script type="text/javascript"> +var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.mysociety.org/" : "http://piwik.mysociety.org/"); +document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); +</script><script type="text/javascript"> +try { +var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 8); +piwikTracker.trackPageView(); +piwikTracker.enableLinkTracking(); +} catch( err ) {} +</script><noscript><p><img src="http://piwik.mysociety.org/piwik.php?idsite=8" style="border:0" alt=""/></p></noscript> +<!-- End Piwik Tag --> +[% ELSE %] +<!-- Tracking code not inserted as "[% c.config.BASE_URL %]" not "http://www.fixmystreet.com" --> +[% END %] diff --git a/templates/web/emptyhomes/tracking_code.html b/templates/web/emptyhomes/tracking_code.html new file mode 100644 index 000000000..73526d3bd --- /dev/null +++ b/templates/web/emptyhomes/tracking_code.html @@ -0,0 +1,12 @@ +<!-- Piwik --> +<script type="text/javascript"> +var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.mysociety.org/" : "http://piwik.mysociety.org/"); +document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); +</script><script type="text/javascript"> +try { +var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 12); +piwikTracker.trackPageView(); +piwikTracker.enableLinkTracking(); +} catch( err ) {} +</script><noscript><img width=1 height=1 src="http://piwik.mysociety.org/piwik.php?idsite=12" style="border:0" alt=""></noscript> +<!-- End Piwik Tag --> |