Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Clicky analytics code

Previous versions of vanilla allowed us to insert any tracking code before
Before: the default.master.php
Now: default.master.ptl

Is the file extension playing a role?

Best Answer


  • TamaTama United Kingdom ✭✭✭

    use these tags in your theme's .tpl ( Smarty ) file.

    // Tracking code

    to insert custom javascript

    There was an error rendering this rich post.

  • edited July 2013

    is this correct?
    {literal} <script src="//" type="text/javascript"></script> <script type="text/javascript">try{ clicky.init(xxxxx); }catch(e){}</script> <noscript><p><img alt="Clicky" width="1" height="1" src="//" /></p></noscript> {/literal} </body> </html>

  • Thanks @peregrine this sounds difficult for me

  • Does it make a difference if inserted by themehooks or {literal}? Can someone please give an example how on how to add such jscript code as afterbody event?

  • Ok, manged it by themehooks now, which was quite simple as in

       public function Base_AfterBody_Handler($Sender) {
                    if ($Sender->MasterView == 'admin') return;
                    echo <<<YourCode
    *Put your code here*
  • Hope I am not too late, just made a plugin:

  • I use the POCKETS plugin for stuff like this

Sign In or Register to comment.