The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Statcounter Tracking / Plugin
Hello,
I have been trying to find an answer to this here and on the .com site, but cannot seem to find it. Everyone wants the statcounter code in the templates, but I would like to create a plugin for it. (Why? Because I have multiple templates and do not want to have to put it in all the footers) With that said.. How can I put <script> tags in a plugin? The counter doesn't appear to be tracking when it is put in there 'as is'. The code is this: Code:
<!-- Start of StatCounter Code --> <script type="text/javascript"> var sc_project=2089680; var sc_invisible=1; var sc_security="87f60d6a"; </script> <script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><a title="vBulletin analytics" class="statcounter" href="http://www.statcounter.com/vbulletin/"><img class="statcounter" src="http://c.statcounter.com/2089680/0/87f60d6a/1/" alt="vBulletin analytics" /></a></div></noscript> <!-- End of StatCounter Code --> I also tried: $output = '{code above}'; But didn't notice any tracking. Any help would be much appreciated! |
#2
|
|||
|
|||
you need to put the javascript in a template and call the template with your plugin code.
for example create a template called mystatcounter, dump your block of code in there and save it. Then create a statcounter plugin with something like : PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|