Google Analytics by MonsterInsights
Cross Domain Bug (with code fix) (4 posts)

  1. David
    Posted 3 years 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;


  2. carlmagnus
    Posted 3 years ago #

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

  3. David
    Posted 3 years ago #

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

  4. carlmagnus
    Posted 3 years 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

  • Google Analytics by MonsterInsights
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic