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);
});