Title: Cross Domain Bug (with code fix)
Last modified: August 20, 2016

---

# Cross Domain Bug (with code fix)

 *  [David](https://wordpress.org/support/users/dh22/)
 * (@dh22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/cross-domain-bug-with-code-fix/)
 * 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/](http://wordpress.org/extend/plugins/google-analytics-for-wordpress/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [carlmagnus](https://wordpress.org/support/users/carlmagnus/)
 * (@carlmagnus)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/cross-domain-bug-with-code-fix/#post-3574081)
 * Been racking my brain on this too – found the fix by removing the extra ” in 
   line 367 of class-frontend.php
 *  Thread Starter [David](https://wordpress.org/support/users/dh22/)
 * (@dh22)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/cross-domain-bug-with-code-fix/#post-3574284)
 * Not corrected yet and had to redo the fix after the update so bumping this back
   up.
 *  [carlmagnus](https://wordpress.org/support/users/carlmagnus/)
 * (@carlmagnus)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/cross-domain-bug-with-code-fix/#post-3574290)
 * Thanks David – just picked up on that too. Wonder why he didn’t fix it?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cross Domain Bug (with code fix)’ is closed to new replies.

 * ![](https://ps.w.org/google-analytics-for-wordpress/assets/icon.svg?rev=2976619)
 * [MonsterInsights - Google Analytics Dashboard for WordPress (Website Stats Made Easy)](https://wordpress.org/plugins/google-analytics-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-analytics-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-analytics-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-analytics-for-wordpress/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [carlmagnus](https://wordpress.org/support/users/carlmagnus/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/cross-domain-bug-with-code-fix/#post-3574290)
 * Status: not resolved