* Google Analytics Chokes On Long WordPress URLs

So I’m turning off Google Analytics for now.

I just noticed a “broken” link on my published WordPress blog that was not broken when I proofread it. Here is how the code looks before being processed by the Google Analytics Plugin for WordPress from boakes.org:

<a href="http://www.freakonomics.
com/blog/2007/07/12/the-perils-of-popularity-or-how-is-a-frozen-
website-like-a-sick-person/">Reddit</a>

And here is how it looks with the Google Analytics plugin enabled:

<a  onclick="javascript:urchinTracker 
('/outbound/article/www.freakonomics.com');">
Reddit</a>

Part of the problem is that there is no built-in way for WordPress to truncate the %postname% permalink tag by default. My permalink structure is as follows:

/%year%-%monthnum%-%day%-%postname%.html

So if you like having the words from the post’s title be used to form its permalink filename (as I do), then you occasionally have to live with ridiculously long filenames. If there is a WordPress plugin that fixes this problem, one that allows you to truncate the %postname% tag, then I am unaware of it. But the ability to truncate the filename to some reasonable number of characters should be a feature of the default installation of WordPress.

So I get to make a choice. I can either have links to long URLs working or I can have Google Analytics working. I choose the former. So goodbye Google Analytics (for now).

Print Friendly, PDF & Email

2 Replies to “* Google Analytics Chokes On Long WordPress URLs”

  1. Greetings Art,

    Yes I am. It is a problem with the Google Analytics Plugin, which is not written by Google. So the real question is: Why isn’t the Google Analytics Plugin written by Google? Why isn’t it easier to implement in WordPress? Why doesn’t it work in this case? OK, there is more than one real question.

    Regards,
    Erik

  2. I think you are blaming Google Analytics for a problem with the Google Analytics plug-in.

    I think if you manually inserted the google analytics into the footer or header space (don’t know word press, so not sure if you can do it), it should just work.

Leave a Reply to Art Mellor Cancel reply

Your email address will not be published. Required fields are marked *