Support » Plugins » [Plugin: Google Analytics for WordPress] Adds a duplicate onclick attribute to links

  • Resolved mohanjith


    Plugin adds a duplicate onclick attribute to links when “Track outbound clicks & downloads” is enabled. This specifically causes WordPress to generate invalid mark up with the AddThis plugin.

    I suggest that the $coolBit is added to the existing onclick attribute (without onclick=””) else a new onclick attribute is added with the $coolBit.

    I have created a patch (with Git), you can download it from my blog.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mohanjith


    Looks like even the new release (2.8) doesn’t fix this issue.

    Joost de Valk


    Thanks for the patch, added it in 2.9!



    Hi Joost, I’ve upgraded to 2.9 and was hoping from the changelog that all my problems would be solved, but tracking outbound links still messes up my highslide (photo overlay plugin) integration. I’ve added the code for one of the links below. Any chance of getting these two to play nice?

    Thanks for the great plugin,

    With track links/dl checked (highslide doesn’t work):

    <div class="shashin_thumb" style="width: 150px; float: ; clear: ;"><a href="<em>longrandomstring</em>.jpg"  class="highslide" id="thumb1" onclick="javascript:pageTracker._trackPageview('ar_/'); return hs.expand(this, { autoplay: false, slideshowGroup: "group1' })"><img src="<em>longrandomstring</em>.jpg?imgmax=144" alt=" Photos" title="" width="144" height="108" /></a></div>

    With track links/dl disabled (highslide does work):

    <div class=&quot;shashin_thumb&quot; style=&quot;width: 150px; float: ; clear: ;&quot;><a href=&quot;<em>longrandomstring</em>.jpg?imgmax=640&quot; class=&quot;highslide&quot; id=&quot;thumb6&quot; onclick=&quot;return hs.expand(this, { autoplay: false, slideshowGroup: 'group1' })&quot;><img src=&quot;<em>longrandomstring</em>.jpg?imgmax=144&quot; alt=&quot; Photos&quot; title=&quot;&quot; width=&quot;144&quot; height=&quot;108&quot; /></a></div>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Google Analytics for WordPress] Adds a duplicate onclick attribute to links’ is closed to new replies.