Web Intents Event callback has data == null


We have a tweet link with a web intent href, and the twitter javascript preloaded onto the page. Code below. When a tweet is made, our function is passed the event object but the event contains only region and type. event.data however is null. that happened both on localhost as well as on the online dev version of our app.

At this point I am not sure what could be the source of the problem and what else we can do to debug it. Any suggestions welcome. Let me know if any follow up information would be useful. Thanks so much.

twttr.ready(function (twttr) { // bind events here twttr.events.bind('tweet', function(event) { console.info(event); alert(event.data); }); });


The tweet event doesn’t populate the event.data node. You can’t find out any personally identifiable information about the end-user, such as the tweet they posted. You can, however, track the fact that the tweet happened and which DOM element on your page initiated the event.


So what’s the point of having the data node in the first place?

And also, what does this code snippet from twitter intent events documentation do?

— From https://dev.twitter.com/docs/intents/events
Supported by: Tweet Button, Follow Button, & Web Intents
This event will populate the followed user_id in the Event Object’s data method.

twttr.events.bind(‘follow’, function(event) {
var followed_user_id = event.data.user_id;
var followed_screen_name = event.data.screen_name;


The data node is part of the overall shared structure for javascript web intents events – in other events, it is populated with relevant data such as the one you’ve shown – in that case event.data has data on the user that was followed (not the user who did the following). The snippet shows how to capture the ID and screen name of the user that was followed in the event.


It’s says it’s supported by the tweet button. In this case, user_id and screen_name would be those of the user that the person follows in the confirmation screen following the tweets?

Too bad you can’t get access to the event.data information of the twee creator. There are a lot of positive creative things that could have been done with it.


Hi David,

I have put some codes :
twttr.events.bind(‘follow’, function(event) {
var followed_user_id = event.data.user_id;
var followed_screen_name = event.data.screen_name;

but the result of followed_user_id is asolutelty null becase ‘event.data’ have no method ‘user_id’. could you tell me for that problem?



Taylor, how would you know it’s time to reconsider this policy?

If we go through hoops, we can get this “personally identifiable information”. For example, I could use the “via” parameter of the tweet intent to ensure I am @mentioned when the user submits the tweet. I could listen for the email notification that I receive as a result of the mention and pluck the author’s handle and the ID and URL of the tweet out of the text of the email.

Given that this information is already available in email notifications, what reason is there for failing to provide it in the callback?