12

I'm using the AddThis widget to enable the sharing of site content towards Twitter, Facebook and Google+. I have signed in users on my website and am looking into making an association between the signed user and his sharing behavior.

For this I need to listen to the callback of the Addthis widget, here's the direct example from their website:

function shareEventHandler(evt) { 
    if (evt.type == 'addthis.menu.share') { 
        alert(typeof(evt.data)); // evt.data is an object hash containing all event data
        alert(evt.data.service); // evt.data.service is specific to the "addthis.menu.share" event
    }
}

// Listen for the share event
addthis.addEventListener('addthis.menu.share', shareEventHandler);

The problem with this event is that it is triggered before actually sharing something. For example, a user clicks the "Tweet" buttton, this script is triggered, the Tweet dialog is launched, and the user either moves forward or cancels the sharing in that dialog.

Ideally, the event handler is triggered once the actual sharing was done successfully, and not when the user cancels it. It doesn't seem possible from the official documentation, but I wanted to try nevertheless if anyone has a creative workaround?

Mo.
  • 26,306
  • 36
  • 159
  • 225
Fer
  • 4,116
  • 16
  • 59
  • 102
  • I don't think is an API call for that as their website acts exactly like this... click share and press cancel/close... you will get a "Thanks for sharing!" message. AddThis helps in several things, but is not perfect. – balexandre Sep 27 '13 at 21:28
  • @Ferdy It's too old question now and you must have got the way till now. So please share it so that other's cam also know about this. – Dinesh Patil Aug 10 '14 at 10:02
  • @DineshPatil Don't assume I have a solution and are keeping it to myself simply because the question is old. I don't. I never solved it. – Fer Aug 11 '14 at 19:44
  • I am looking for same. If anyone has solution please share. – user1544195 Feb 09 '18 at 05:39

1 Answers1

1

possible workaround:
i'm assuming that post sharing the addthis content box is altered...do a check for this element (probably a class(es)) to ensure sharing success

albert
  • 8,112
  • 3
  • 47
  • 63