4

I am not able to get the callback to work for the twitter follow button using the iFrame version. Here is my code:

<iframe allowtransparency="true" frameborder="0" scrolling="no"
        src="https://platform.twitter.com/widgets/follow_button.html?screen_name=gaur_aditya&show_screen_name=true&show_count=true"
        style="height:20px;"></iframe>

<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
<script type="text/javascript">
    twttr.events.bind('follow', function(event) {
        console.log(event);
        var followed_user_id = event.data.user_id;
        var followed_screen_name = event.data.screen_name;
    });
</script>

I tried out this version which worked fine. But using the iFrame version I am not able to make it work.

Community
  • 1
  • 1
aditya_gaur
  • 3,209
  • 6
  • 32
  • 43

1 Answers1

4

Finally after a bit of research found out that the callbacks are not supported in the iFrame implementation. Here is a discussion on this issue: Twitter follow button iframe integration and callbacks

aditya_gaur
  • 3,209
  • 6
  • 32
  • 43