tracking code

27 views
Skip to first unread message

Julie

unread,
Jan 26, 2008, 1:59:49 AM1/26/08
to TiddlyWiki
I'd like to put Google Analytics tracking code on a TiddlyWiki.

I read this thread:
http://groups.google.com/group/TiddlyWiki/browse_thread/thread/58509d7210c96000/e4de6864dde838c9?lnk=gst&q=tracking+code#e4de6864dde838c9
but it was over my head.

I read this one too, but wasn't sure what he meant by 'put it in the
header'
http://groups.google.com/group/TiddlyWiki/browse_thread/thread/ece091457e844949/21f3d973343fb777?lnk=gst&q=tracking+code#21f3d973343fb777

Did he mean SiteTitle?

Thanks,
Julie

FND

unread,
Jan 26, 2008, 3:56:34 AM1/26/08
to Tiddl...@googlegroups.com
> I'd like to put Google Analytics tracking code on a TiddlyWiki.

PhilH has written a guide for that a while back:
http://tinyurl.com/yw9dn5
(http://www.hawksworx.com/journal/2007/07/05/tracking-tiddlywiki-with-google-analytics)
It's linked to from the community wiki (though an actual guide there
would certainly be nice... ):
http://www.tiddlywiki.org/wiki/Google_Analytics

HTH.


-- F.

Julie

unread,
Jan 26, 2008, 4:30:07 AM1/26/08
to TiddlyWiki

> PhilH has written a guide for that a while back:
> http://tinyurl.com/yw9dn5
> (http://www.hawksworx.com/journal/2007/07/05/tracking-tiddlywiki-with-...)

That's great. Got lost a little way in, but have successfully loaded
code to at least track visitors to the site as a whole in the
meantime.

> It's linked to from the community wiki (though an actual guide there
> would certainly be nice... ):
> http://www.tiddlywiki.org/wiki/Google_Analytics

Yes, FND, an actual guide certainly would be nice. And if ever I feel
I properly understand how it works I'd be happy to write one:)


Also, I found this on a blog Phil recommended (http://
blog.spacelag.com/2007/10/tracking-tiddlywiki-with-google.html).

It's code to go in a tiddler he calls CustomTracker and allows Google
to track activity for individual tiddlers (this was the part of Phil's
blog that I didn't understand).

If I pasted this into my own tiddler, and changed the account number,
what else would I have to do to make it work for me? (If anyone's got
the time to look at this)

{{{
// Specify your account number here!
_uacct = "UA-1234567-1";

// CustomTracker as a namespace for tracking related functions
var CustomTracker = {
// store a reference to the original displayTiddler function
displayTiddler: story.displayTiddler
};

CustomTracker.track = function() {
if (readOnly) {
urchinTracker.apply(this, arguments);
}
};

CustomTracker.trackAndDisplayTiddler = function(srcElement, titles) {
// log with the tracker
CustomTracker.track('/' + titles);
// call the original displayTiddler function
CustomTracker.displayTiddler.apply(this,arguments);
};

// replace the default displayTiddler function with a tracking version
story.displayTiddler = CustomTracker.trackAndDisplayTiddler;

// Call once for the initial page load
CustomTracker.track();
}}}



Big thanks, Julie
Reply all
Reply to author
Forward
0 new messages