Page 1 of 1

Web CEO tracking code

Posted: Fri May 18, 2012 10:15 pm
by terrysv
We use Web CEO for web statistics and I have to insert a snippet of code before the </body> tag. I am using the Competition template. Where or how do I place the code? Thanks.

Re: Web CEO tracking code

Posted: Fri May 18, 2012 10:29 pm
by Don Chambers
I presume you mean the "Coffee Cup" template, which is stored in a folder named "competition".... That template has a file named index.tpl... Look toward the bottom of the file for the </body> tag.

In a perfect world, you would first copy all files to a new folder of its own, then edit the file in that new folder named info.txt, giving the template a new name, such as "Modified Coffee Cup". Doing this will prevent any of your modifications from being overwritten if/when you upgrade serendipity as the coffee cup/competition is included in each full serendipity release.

Re: Web CEO tracking code

Posted: Fri May 18, 2012 10:43 pm
by yellowled
Depending on the "nature" of the code snippet, you might also have to do something to it which is called "escaping". Files like index.tpl are Smarty files. The code of your snippet might include characters which are reserved in Smarty, most likely { and }. This would i.e. happen if your code snippet was a piece of Javascript (which a lot of tracker codes are).

If that's the case, replace instances of { in your tracking code with {ldelim} as well as instances of } with {rdelim}. If you're unsure, you can post your tracking code here.

YL

Re: Web CEO tracking code

Posted: Fri May 18, 2012 10:48 pm
by Don Chambers
Excellent point YL! :wink:

Re: Web CEO tracking code

Posted: Mon May 21, 2012 5:37 pm
by terrysv
Thank you both for great advice. It works great!