Menu

Wikindx and Piwik

Help
Joachim
2013-05-29
2013-05-31
  • Joachim

    Joachim - 2013-05-29

    Hi Mark,

    I'm just trying to put a Piwik onto my Wikindx, in order to track its usage. But Wikindx doesn't seem to like Piwik's Java tracking code, as soon as I put the code snippet in the footer.tpl (I'm using the Simple Blue template) the footer disappears from the page, i.e. the whole footer HTML part isn't displayed in the browser.

    This is the incriminated code snippet:

    <!-- Piwik -->
    <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(["setDomains", ["*.www.comicforschung.uni-bonn.de","*.www.germnet.uni-bonn.de"]]);
      _paq.push(["trackPageView"]);
      _paq.push(["enableLinkTracking"]);
    
      (function() {
        var u=(("https:" == document.location.protocol) ? "https" : "http") + "://webbel.germanistik.uni-bonn.de/piwik/";
        _paq.push(["setTrackerUrl", u+"piwik.php"]);
        _paq.push(["setSiteId", "1"]);
        var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
        g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
      })();
    </script>
    <!-- End Piwik Code -->
    

    Any thoughts or proposals to get Piwik to work with Wikindx?

    Regards
    Joachim

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-05-30

    I'll look into it Joachim,

    Mark

     
  • Notis Toufexis

    Notis Toufexis - 2013-05-30

    Same with Google analytics, both in header.tpl and footer.tpl

    <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', 'UA-41310562-1', 'uni-hamburg.de'); ga('send', 'pageview'); </script>
     
  • Mark Grimshaw

    Mark Grimshaw - 2013-05-30

    See http://www.smarty.net/forums/viewtopic.php?t=150

    I used {ldelim} and {rdelim} to replace { and } and to insert a script into the tpl files

     
  • Notis Toufexis

    Notis Toufexis - 2013-05-30

    {litera} and {/literal} works too with Google Analytics.

    Thanks Mark.

    Notis

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-05-30

    perfect.

     
  • Joachim

    Joachim - 2013-05-31

    For the records: I've put {literal} and {/literal} after and before the <script> tags, works great.

    Thanks Mark and Notis!
    Joachim

     

    Last edit: Joachim 2013-05-31
  • Mark Grimshaw

    Mark Grimshaw - 2013-05-31

    Great.

    Mark

     

Log in to post a comment.