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

audit audit at c2security.org
Tue Apr 21 13:58:48 CEST 2009


On Mon, 20 Apr 2009, Mark Sapiro wrote:

> audit wrote:
>
>> I'm trying to inset google-analytics.com in mailman archives and when I
>> use the normal new coding to insert in the templates, it gives me strange
>> script errors when I view the pages after running bin/arch listname
>
>
> You should be able to insert the javascript into the templates
> archtoc.html, archtocnombox.html, archidxhead.html and article.html
> and have it work?
>
> 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

     * %(prev_wsubj)s %(next_wsubj)s Messages sorted by: [ date ] [ thread 
] [ subject ] [ author ]

%(body)s

     * %(prev_wsubj)s %(next_wsubj)s Messages sorted by: [ date ] [ thread 
] [ subject ] [ author ]

More information about the %(listname)s mailing list

Can be seen at 
http://www.dataoutages.com/pipermail/bb-dev/2009-March/000006.html for the 
next couple hours before I remove the newer code and revert back to the 
old code in hopes that someone can see this and understand what I'm doing 
wrong. You can also see the phpads code in the source and what code is 
being used for that. It's working fine.


>
> What do you see if you view the raw source of the page or if you view
> the .html files in the archive?

Everything looks normal when I view the page source code.

>
>
>> If I run the old code then it works fine but I was just reading that the
>> old code may not show the correct stats.
>
>
> Do you know the new code works? Maybe it's not compatible with your
> browser?
>
>

Google recommends getting away from the old Legacy Tracking code 
(urchine.js) and going with the new code (ga.js)


This code works but doesn't track.

<script src="http://www.google-analytics.com/urchin.js" 
type="text/javascript">
</script>
<script type="text/javascript">
try {
_uacct = "UA-548858-10";
urchinTracker();
} catch(err) {}</script>


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>



Thanks
audit


>
>> I have my phpads showing just fine with the script code so I don't
>> understand why the google code won't work when I add that.
>
>
> 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?
>
> -- 
> 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