WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics for WordPress
Cross Domain Bug (with code fix) (4 posts)

  1. David
    Member
    Posted 1 year ago #

    There is an error in the code that processes cross domain links. An extra " is being added to the end of the onclick code.

    On line 367 in class-frontend.php:
    $trackBit = '_gaq.push([\'_link\', \'' . $matches[2] . '//' . $matches[3] . '\']); return false;"';

    $trackBit is closed with a "

    However, later on line 394, a second " is added after $trackBit.
    $matches[4] = 'onclick="javascript:' . $trackBit . '"' . $matches[4];

    As far as I know this only affects cross domain. I think in other cases $trackBit is left open until line 394. It seems to work properly if I remove the " from line 367 after return false;

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

  2. carlmagnus
    Member
    Posted 1 year ago #

    Been racking my brain on this too - found the fix by removing the extra " in line 367 of class-frontend.php

  3. David
    Member
    Posted 1 year ago #

    Not corrected yet and had to redo the fix after the update so bumping this back up.

  4. carlmagnus
    Member
    Posted 1 year ago #

    Thanks David - just picked up on that too. Wonder why he didn't fix it?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic