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

  1. eierkoek
    Posted 3 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


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