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?
0
Best Answer
-
peregrine MVP
just add it to your themehooks. see themehooks documentation on how to do it and check this forum. I personally try to avoid literals for jscript and php code.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
5
Answers
use these tags in your theme's .tpl ( Smarty ) file.
to insert custom javascript
There was an error rendering this rich post.
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>
just add it to your themehooks. see themehooks documentation on how to do it and check this forum. I personally try to avoid literals for jscript and php code.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
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
Hope I am not too late, just made a plugin:
(http://vanillaforums.org/addon/clicky-plugin-1.0)
I use the POCKETS plugin for stuff like this