Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-31 18:00:07

iaian7
Plugin Author
From: US
Registered: 2006-12-05
Posts: 57
Website

Using Google Analytics file tracking with Textile links

I’ve been running 4.0.4 for awhile on my blog, and just recently updated to 4.0.6. I had originally hacked /textpattern/lib/classTextile.php to add Google Analytics urchin.js tracking to links, instead of titles (seemed like the easiest way to do it for file / click tracking).

I updated the 4.0.6 version similarly, changing the classTextile.php file to output the code for the newer Google Analytics ga.js file tracking. I’ve double checked everything, and it should all be correct…

Replacing:
$atts .= ($title != '') ? ' title="' . $this->encode_html($title) . '"' : '';

With:
$atts .= ($title != '') ? ' onClick="javascript: pageTracker._trackPageview(\'/' . $this->encode_html($title) . '\'); "' : '';

However, when I load a page, it’s using the old hacked code (for urchin.js) I had on the old site! I can’t find any reason for this, unless Textpattern has cached the classTextile.php page somewhere in the database, and is using the old one. When I run the TXP diagnostics, it correctly shows that classTextile.php has been modified, I can only hope it means the file on the server! Going through the database, I can’t find where the [very] old file might be stored, and all the files on the server were replaced when I upgraded to 4.0.6… so…

any ideas? I’m rather baffled at what I must be missing here… thanks!


VFX artist, photographer, designer, CG generalist, and hobbyist web developer
My TXP sites: blog | reels | portfolios

Offline

#2 2008-10-31 19:21:03

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Using Google Analytics file tracking with Textile links

Recently, we employed jQuery to do the trick.

As for the caching, you should be aware of the fact that the Textile-to-HTML transformation is applied just whenever you save the article, not every time the article is viewed. So, in fact the Textile output is cached, and the new Textile.php won’t come into play as long as you do not resave an article.

Offline

#3 2008-10-31 21:35:04

iaian7
Plugin Author
From: US
Registered: 2006-12-05
Posts: 57
Website

Re: Using Google Analytics file tracking with Textile links

Oooooh… that explains EVERYTHING! Thanks so much! :D


VFX artist, photographer, designer, CG generalist, and hobbyist web developer
My TXP sites: blog | reels | portfolios

Offline

Board footer

Powered by FluxBB