The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index General discussions Web CEO tracking code

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

Postby terrysv » Fri May 18, 2012 10:15 pm

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.

User avatar
Don Chambers
Regular
 
Posts: 3077
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA

Postby Don Chambers » Fri May 18, 2012 10:29 pm

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.

User avatar
yellowled
Regular
 
Posts: 4885
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany

Postby yellowled » Fri May 18, 2012 10:43 pm

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

User avatar
Don Chambers
Regular
 
Posts: 3077
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA

Postby Don Chambers » Fri May 18, 2012 10:48 pm

Excellent point YL! :wink:

terrysv
 
Posts: 2
Joined: Fri May 18, 2012 10:09 pm

Postby terrysv » Mon May 21, 2012 5:37 pm

Thank you both for great advice. It works great!



Return to General discussions

Who is online

Users browsing this forum: No registered users and 1 guest