Support » Plugins » Bookmarklet links broken by Google Analytics for WordPress

  • Is there a way to get the Google Analytics for WordPress plugin to ignore bookmarklet links? I’m working on a post and it’s turning this link:

    <a href="javascript:void(\w+:\/\/[w{3}\.]*/,'https://authoring.')).replace(/(\/[^\/]+$)|\/$/,'/login.cfm'),''),'0');">LoginCommonSpot</a>

    Into this:
    <a href="javascript:void(\w+:\/\/[w{3}\.]*/,'https://authoring." onclick="javascript:pageTracker._trackPageview('/outbound/article/javascript:void(\w+:\/\/[w{3}\.]*/,'https://authoring.');")).replace(/(\/[^\/]+$)|\/$/,'/login.cfm'),''),'0');">LoginCommonSpot</a>

Viewing 8 replies - 1 through 8 (of 8 total)
  • I was looking thru the plugin code and I think I know what needs to be changed.
    line 439
    static $anchorPattern = '/<a (.*?)href=[\'\"](.*?)\/\/([^\'\"]+?)[\'\"](.*?)>(.*?)<\/a>/i';

    Change this regex to exclude links that start with “javascript”. Any regex experts wanna take a crack at that?

    I posted to a regex specific forum asking for help with this here:

    Thanks to Aussie Susan! She replied at the above mentioned regex forum with the answer to my problem.

    Here’s the code that’s working for me now:
    static $anchorPattern = '/<a (.*?)href=[\'\"](?!javascript)(.*?)\/\/([^\'\"]+?)[\'\"](.*?)>(.*?)<\/a>/i';

    I’m going to email the plugin author and suggest incorporating this change into the next release.

    Dang…I just noticed that my Bookmarkify’s ‘More’ link wasn’t working. Found out that it is Google Analytics causing the problem.
    I was stoked to find your thread…but I tried your code above and am not getting any results. My ‘more’ function is still ‘broken’.


    Anyone else have any ideas?

    *Thx for posting your solution SimonDorfman 🙂

    This should have been fixed in the 2.9 release, can anyone confirm? 🙂

    NOpe…I just updated and activated the plugin to test. It breaks my bookmarktify’s ‘more’ link still.

    Any word on this Joost?
    Or, anyone found a workaround?

    2.9.2 might fix it…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Bookmarklet links broken by Google Analytics for WordPress’ is closed to new replies.