Skip to content

Instantly share code, notes, and snippets.

Last active February 4, 2016 05:23
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
AddThis implementation (that actually works!) (add your AddThis analytics profile ID!)
<a class="addthis_button_facebook" target="_blank" href="<?php the_permalink(); ?>">Facebook</a>
<a class="addthis_button_twitter" target="_blank" href="<?php the_permalink(); ?>">Twitter</a>
<a href="" class="addthis_button">Share this</a>
<script type="text/javascript">
var addthis_config = addthis_config || {};
addthis_config.data_track_clickback = false; //tracking codes added to URLs after a share event
addthis_config.data_track_addressbar = false; //tracking codes added to URL in the address bar using JavaScript
addthis_config.ui_click = true; //open share panel on click (not hover)
<script type="text/javascript" src="//"></script>
<!-- OR -->
<a href="" class="addthis_button" addthis:ui_click="true" addthis:data_track_clickback="false" addthis:data_track_addressbar="false">Share this</a>
<script type="text/javascript" src="//"></script>
The <a> tag must be "display: block;" and must have something in it (or a graphic will be added inside it) (use a hide-text CSS technique)
Reference for Addthis:
Click tracking:
Open menu on click:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment