Follow Web Intent Not Triggering Bound Function


#1

I’ve been trying to do some simple analytics testing much like the Google Analytics example at the bottom of (https://dev.twitter.com/docs/intents/events). Unfortunately the function I have defined for the follow web intent is never triggered. All of the other intents execute the appropriate code and all of the follow functionality (except my javascript function) seems to work fine. Are there any special conditions, issues that I don’t know about or can anyone see anything wrong with the javascript code below? Any help would be greatly appreciated.

window.twttr = (function (d,s,id) {

  var t, js, fjs = d.getElementsByTagName(s)[0];

  if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;

  js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);

  return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });

}(document, "script", "twitter-wjs"));

function trackOther(intentEvent) {
   alert('you clicked something');
}

function trackFollow(intentEvent) {
   alert('you clicked follow');
}

twttr.ready(function (twttr) {
   twttr.events.bind('click', trackOther);
   twttr.events.bind('tweet', trackOther);
   twttr.events.bind('retweet', trackOther);
   twttr.events.bind('favorite', trackOther);
   twttr.events.bind('follows', trackFollow);
});

#2

Have you tried with

twttr.events.bind(‘follow’, trackFollow);

instead of

twttr.events.bind(‘follows’, trackFollow);

(no “s” after follow)


#3

Sorry for the delayed response. Ha ha, didn’t realize I posted my attempt with the ‘s’. Yeah I tried without the ‘s’ as well. I will try again just in case I’m mis-remembering and will ping back with the results. Thanks for responding to my thread.


#4