WordPress.org

Forums

Google Analytics by Yoast
Cross domain tracking and target _blank (1 post)

  1. jsl-1
    Member
    Posted 1 year ago #

    Hi,

    I found a little problem with Cross Domain Tracking when target is set to _blank. The link don't open in a new window.

    I found a workaround. "_gaq.push" prevent "return false" to act normaly. So i set a timeout to "gaq.push" to force return false to execute immediately.

    Here is the code replacement i make in google analytics for wordpress v4.3.5 :
    frontend/class-frontend.php Line 367
    replace
    $trackBit = '_gaq.push([\'_link\', \'' . $matches[2] . '//' . $matches[3] . '\']); return false;"';
    by
    $trackBit = 'setTimeout("_gaq.push([\'_link\', \'' . $matches[2] . '//' . $matches[3] . '\'])",100); return false;';

    Is there plan to fix these problem ?

    Thanks

    https://wordpress.org/plugins/google-analytics-for-wordpress/

Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic