Google Analytics for WordPress plugin adds an onclick attribute to links when “Track outbound clicks & downloads” is enabled irrespective of whether there is already an onclick attribute. AddThis plugin adds a link with onclick attribute to the post when enabled. This combination causes WordPress to generate invalid mark up. Same would happen if the post contains any links with onclick attribute (very unlikely scenario).
I have created a patch (with Git) that adds the content of $coolBit to the existing onclick attribute (without onclick=””) else a new onclick attribute is added with the $coolBit. You can download the patch. I have also reported the issue to Joost (plugin developer).
Hope this will be useful for someone in a similar situation until the fix makes it into the plugin.
2 thoughts on “Google Analytics for WordPress plugin is incompatible with AddThis plugin”
I really liked this post. Can I copy it to my site? Thank you in advance.
No, but you may translate 🙂 (I believe that’s what you want) . I would appreciate if you have a link to the original post.