[Mailman-Users] How to insert google-analytics.com in mailmanarchives

Mark Sapiro mark at msapiro.net
Tue Apr 21 18:44:10 CEST 2009

audit wrote:

>On Mon, 20 Apr 2009, Mark Sapiro wrote:
>> What errors do you get?
>This is the error that I get when I view the date and article for that 
>date after I put the following code into the article.html file
>%(encoding)s %(prev)s %(next)s
>%(author_html)s %(email_html)s

Interpolation into the template is failing. See below.

>This is the code I'm trying to use but get the above errors with.
><script type="text/javascript">
>var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." 
>: "http://www.");
>document.write(unescape("%3Cscript src='" + gaJsHost + 
>"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
><script type="text/javascript">
>try {
>var pageTracker = _gat._getTracker("UA-548858-10");
>} catch(err) {}</script>

>> Templates have values interpolated into them. I.e. strings like
>> %(name)s, etc. get replaced by the value of 'name'. This means in
>> particular that if you want to put a literal '%' character in a
>> template, you have to double it ('%%'). Is this the problem?

This says you need to double every '%' in the above code when adding it
to the template as in

document.write(unescape("%%3Cscript src='" + gaJsHost +

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list