Advertisement
webpagefxjared

FB track like

Aug 11th, 2011
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. (function() {
  2.  
  3.  
  4. var _gaq = _gaq || [];
  5.  
  6. try{
  7.  
  8. if(FB && FB.Event && FB.Event.subscribe){
  9.  
  10. FB.Event.subscribe('edge.create', function(targetUrl) {
  11. //console.log('liked!');
  12. _gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]);
  13. });
  14.  
  15. FB.Event.subscribe('edge.remove', function(targetUrl) {
  16.  
  17. _gaq.push(['_trackSocial', 'facebook', 'unlike', targetUrl]);
  18. });
  19. }
  20.  
  21.  
  22.  
  23. }
  24.  
  25. }catch (e) {}
  26.  
  27. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement