The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Google Analytics by MonsterInsights
[Plugin: Google Analytics for WordPress] Track Outbound Clicks Issue? (1 post)

  1. vicchi
    Posted 4 years ago #

    I've noticed some interesting behaviour when using v4.2.4 of Google Analytics for WordPress with one of my own plugins (http://wordpress.org/extend/plugins/wp-biographia/).

    When Track outbound clicks & downloads is enabled, there seems to be some mangling of a section of HTML that my plugin emits with the return from get_avatar().

    After doing some debugging I can see that the code my plugin and that get_avatar() emits is well structured. Here's an example of this ...

    <div class="wp-biographia-pic" style="height:100px; width:100px;"><img alt='' src='http://1.gravatar.com/avatar/d300ed1dcec487e20c8600570abeffab?s=100&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&r=G' class='avatar avatar-100 photo' height='100' width='100' /></div>

    When Track outbound clicks & downloads is enabled, this output gets mangled somehow, becoming ...

    <div class="wp-biographia-pic" style="height:100px; width:100px;"><img alt="" src="http://1.gravatar.com/avatar/d300ed1dcec487e20c8600570abeffab?s=100&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&r=G" class=" avatar="" avatar-100="" photo'="" height="100" width="100"></div>

    ... note that all the single quotes that get_avatar() emits have been replaced with double quotes and also that the img src is not longer properly terminated and instead runs into the class attribute so that the CSS classes incorrectly become attributes of the img tag.

    When I disable Track outbound clicks & downloads this problem vanishes.

    To try and narrow down the scope of the issue I've used the stock WordPress Twenty Ten theme and disabled all other plugins with the exception of Google Analytics for WordPress and my WP Biographia plugin. It seems like they're not playing well together, despite the code that my plugin emits being valid and well structured.

    Is this a known issue or is there a workaround?




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