WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Google Analytics for WordPress] Adds a duplicate onclick attribute to links (4 posts)

  1. mohanjith
    Member
    Posted 5 years ago #

    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.

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

  2. mohanjith
    Member
    Posted 5 years ago #

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

  3. Joost de Valk
    Member
    Posted 5 years ago #

    Thanks for the patch, added it in 2.9!

  4. jmdr
    Member
    Posted 5 years ago #

    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,
    Jonathan

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

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

Topic Closed

This topic has been closed to new replies.

About this Topic