Web CEO tracking code

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
terrysv
Posts: 2
Joined: Fri May 18, 2012 10:09 pm

Web CEO tracking code

Post 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.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Web CEO tracking code

Post 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.
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Web CEO tracking code

Post 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
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Web CEO tracking code

Post by Don Chambers »

Excellent point YL! :wink:
=Don=
terrysv
Posts: 2
Joined: Fri May 18, 2012 10:09 pm

Re: Web CEO tracking code

Post by terrysv »

Thank you both for great advice. It works great!
Post Reply