Urchin Tracking Monitor... one small problem

I've just gone to set this up on the first of many sites. For those that are unfamiliar, the Google Urchin Tracking Monitor uses a piece of Javascript embedded in your page ( template ), plus a small .gif image.


The name of the .gif starts with two underscores - __utm.gif. Pretty sure changing the name means UTM won't work.



Double underscores are reserved for system URL's in MSM… so I can't do it.



Ideas, anyone? :blink:

That's right, it's there to prevent you from using the path that would conflict with live public files. It's one file, so I wouldn't see any issues in maintaining this file outside of matrix. You could put it in the matrix public data directory <system_root>/data/public/ and access it via the url <site_url>/__data/__utm.gif

[quote]
It's one file, so I wouldn't see any issues in maintaining this file outside of matrix. You could put it in the matrix public data directory <system_root>/data/public/ and access it via the url <site_url>/__data/__utm.gif

[/quote]



I concur; I believe this would probably work. If you wanted to be cleaner with it, you could always place it inside its own directory (eg. [font="monospace"][SYSTEM ROOT]/data/public/urchin[/font]) and access it from there.



The included javascript file ([font="monospace"]urchin.js[/font]) doesn't necessarily have to join it - this can be stored in Matrix if you want, or alongside the image bug. The crucial file that Urchin looks for in your logs is your [font="monospace"]__utm.gif[/font] file… and in my experience, Urchin tends not to care where the [font="monospace"]__utm.gif[/font] file is - as long as the name is correct, and that it's being hit (rather than 404'd).



You would need to point the tracker code in your Design asset template to the correct location of [font="monospace"]__utm.gif[/font], though. This code (although untested by me) would likely work in a Design parse file:



[html]

<script src="[path to urchin.js]" type="text/javascript"></script>

<script type="text/javascript">

var _ugifpath="/__data/urchin/__utm.gif";

urchinTracker();

</script>

[/html]



You'd need to change the [font="monospace"]_ugifpath[/font] variable to wherever in the data directory the image bug is accessible from.



The path to urchin.js would depend on where you stored it:


  • If you stored it alongside [font="monospace"]__utm.gif[/font] in the [font="monospace"]data/public[/font] directory, then the path would be a [font="monospace"]__data[/font] path similar to what that is.
    [*]If you stored it in Matrix, it'd either be the path to it, or possibly a global keyword replacement like [font="monospace"]%global_asset_href:[urchin_assetid]%[/font].


Hope something in this helps. :)

[i][b]PS: the above advice applies to Urchin 6 (the current version) only.[/b] The UTM code in Urchin 5 or earlier seems to not support changing the path of where to find the image bug. While you'd still have to place it outside your system, you'd have to do something else (like adding an explicit alias for it in your server configuration) to make it think it's at the root of your site.[/i]

[i]PS: Apologies in advance if the above is dense; there are plenty of options with what to do with the [font="monospace"]urchin.js[/font] that all bases need to be covered.[/i]