2

Here is my [code][1].

JS: 
function followIntentToAnalytics (intentEvent) {
  if (!intentEvent) return;
  var label = intentEvent.data.user_id + " (" + intentEvent.data.screen_name + ")";
  pageTracker._trackEvent(
    'twitter_web_intents',
    intentEvent.type,
    label
  );
}


twttr.ready(function (twttr) {
  // Now bind our custom intent events
  twttr.events.bind('click', clickEventToAnalytics);
  twttr.events.bind('tweet', tweetIntentToAnalytics);
  twttr.events.bind('retweet', retweetIntentToAnalytics);
  twttr.events.bind('like', likeIntentToAnalytics);
  twttr.events.bind('follow', followIntentToAnalytics);
});

HTML:

<a href="https://twitter.com/ravikumar_j" class="twitter-follow-button" data-show-count="false"  data-size="large">Follow @ravikumar_j</a>

By clicking follow button it should open a pop-up, then user will follow that user_id. Based on the status of twitter login he will follow or not thereafter.

The actions after clicking on follow button follows: 1. A pop up will be open 2. User may follow the intend twitter id on close the popup. 3. User may close the popup without making any action.

As soon as 1 action(above) happens the followIntentToAnalytics(intentEvent) function exiting irrespective of 2&3 actions. Can you help here to model the response and action on 2&3 also?

PS: I want to alert when user performs 3 action i.e, clicks on follow but do not follow the user. thanks

Community
  • 1
  • 1
  • I found that this change was made to API on Nov 20 and effective there on.. here https://twittercommunity.com/t/forthcoming-change-to-web-intent-events/54718 – Ravikumar Jogu Nov 30 '15 at 07:05

0 Answers0