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

audit audit at c2security.org
Tue Apr 21 19:29:10 CEST 2009


On Tue, 21 Apr 2009, Mark Sapiro wrote:

> 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
>> %(subject_html)s
>> %(author_html)s %(email_html)s
>> %(datestr_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>
>> <script type="text/javascript">
>> try {
>> var pageTracker = _gat._getTracker("UA-548858-10");
>> pageTracker._trackPageview();
>> } 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 +
> "google-analytics.com/ga.js'
> type='text/javascript'%%3E%%3C/script%%3E"));
>

I tried that and got the same errors as before. I'm just giving up on that 
idea for now until I can work out something better.

Thanks for the help though.


>
> -- 
> 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