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

Answers

  • TamaTama United Kingdom ✭✭✭

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

    {literal}
    // Tracking code
    {/literal}
    

    to insert custom javascript

    There was an error rendering this rich post.

    ahmedaladdinhgtonight
  • edited July 2013

    is this correct?
    {literal} <script src="//static.getclicky.com/js" 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="//in.getclicky.com/xxxxx.gif" /></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*
    
    YourCode;
       }
    
    hgtonight
  • Hope I am not too late, just made a plugin:
    (http://vanillaforums.org/addon/clicky-plugin-1.0)

    hgtonightphreak
  • I use the POCKETS plugin for stuff like this

    hgtonight
Sign In or Register to comment.