WordPress.org

Forums

Google Analytics by Yoast
[Plugin: Google Analytics for WordPress] Fix for tracking outbound traffic, downloads, ... (1 post)

  1. eierkoek
    Member
    Posted 2 years ago #

    The tracking-gif (__utm.gif) from google analytics does not load in time for logging outbound traffic, downloads and all other sorts of exotic links. To fix this I changed the following:

    In function ga_get_tracking_link

    instead of:
    return $jsprefix . "_gaq.push(" . $pushstr . ")";

    I now use:
    return $jsprefix . "that=this;_gaq.push(" . $pushstr . ");setTimeout(function() { if (that.target=='_blank') {window.open(that.href);} else {location.href=that.href;} }, 200);return false;";

    I hope this makes somebody happy and of course that this bug gets fixed in future versions so I don't have to manually update my code every time this plugin gets updated.

    - Alex de Vries

    http://wordpress.org/extend/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