Drupal Sharing Customization

Link Tracking & URL Shorteners

You can shorten the URL and/or attach parameters to shared links to get analytics on clickthrus. This setting will only modify shared links for services where shared link tracking is appropriate, such as sharing to Twitter and Facebook, but not bookmarking in Google Bookmarks or Pocket.

In Drupal, add the following JavaScript code to your "Additional JavaScript" box in Configuration > Web services > AddToAny > Additional Options.

In WordPress, add the following JavaScript code to your "Additional JavaScript" box in Settings > AddToAny.

Track shared links in Google Analytics.

var a2a_config = a2a_config || {};
a2a_config.track_links = 'ga';
a2a_config.track_links = 'ga';

Track shared links using the Bitly URL shortener.

var a2a_config = a2a_config || {};
a2a_config.track_links = 'bitly';
a2a_config.track_links_key = 'addtoany|R_cc6a4017b0274d1d86f2397771b70136'; // username|API key delimited by |
a2a_config.track_links = 'bitly';
a2a_config.track_links_key = 'addtoany|R_cc6a4017b0274d1d86f2397771b70136'; // username|API key delimited by |

Track shared links using a custom URL or custom short URL.

var a2a_config = a2a_config || {};
a2a_config.track_links = 'custom';
a2a_config.track_links_key = 'http://example.com/abc123';
a2a_config.track_links = 'custom';
a2a_config.track_links_key = 'http://example.com/abc123';

Tip: You can also modify the shared URL using AddToAny events.

Note: Google is discontinuing their goo.gl URL Shortner. Existing goo.gl short links will continue to redirect.