0

What is the best approach to implement Mixpanel analytics for tracking share plugins.

monical
  • 868
  • 9
  • 15

2 Answers2

0

Tracking third-party social network share plugins need a complex soultion and is possible if the social network API supports callbacks. Then you can catch them on your website and fire tracking events. That is the best and the most accurate method.

On the other side - if you use your own Share buttons - there are a lot of possibilities.

For Facebook - check this solution: Facebook like and share button with callback

In function(response) you need to call Segment TRACK method.

Community
  • 1
  • 1
Many More
  • 101
  • 3
0

Another solution I used in addition to the provider's callbacks when working with tracking iframes/javascript social widgets was:

https://github.com/finalclap/iframeTracker-jquery

pretty darn simple and nifty if you ask me!

    jQuery(document).ready(function($){
$('.iframe_wrap iframe').iframeTracker({
    blurCallback: function(){
        // Do something when the iframe is clicked (like firing an XHR request)
     }
  });
});
sirvon
  • 2,547
  • 1
  • 31
  • 55