Sunday 15 March 2015

javascript - Tracking the facebook like button -


I have a Facebook button on my page, and when I click, I want to track (and By which user, etc.) I have JavaScript running (warning "is running"), but this does not warn "You liked the URL ...", this is where I will put all my arguments:

  $ (Document) .ready (function () {(function (d, s, id) {var js, fjs = d.getElementsByTagName (s) [0]; if (d.getElementById (ID)) return; JS = D.SocketElement (s); js.id = id; jssrc = "//connect.facebook.net/en_US/all.js#xfbml=1"; FJSprintNode.Instant before (JS, FJS);} ( 'Document', 'script', 'facebook-jsddk'); Window.fbAsyncInit = function (warning ("running") FB.Event.subscribe ('edge.create', function (feedback) {warning ('you liked url:' + response);});} ;}); Do anyone know that why is not this firing because such a button is clicked?  

Edit I'm trying to confirm that this page is referencing:

Edit 2 I'm adding such a button via IFrame (the button works properly):

  & lt; Span id = "facebook share-btn" & gt; & Lt; Iframe src = "// www.facebook.com/plugins/like.php?href=<%= item.short_path%> & amp; amp; send = incorrect & amp; layout = buttons_ count & amp; Width = 450 & amp; show_faces = false & amp; amp; & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; Amp; amp; amp; amp; amp; amp; ;; width: 48px; height: 22px; "allowTransparency =" true "& gt; & Lt; / Iframe & gt; & Lt; / Span & gt;    

It has been found that callback is not working (apparently) with iframe method We do. I have switched to the HTML5 method and it works fine.

Setup:
  & lt; Div id = 'fb-root' & gt; & Lt; / Div & gt; & Lt; Script & gt; (Function (D, S, ID) {var js, fjs = d.getElementsByTagName (s) [0]; if (d.getElementById (id)) returns; JS = D.Socket element (s); js.id = Id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore (js, fjs);} (document, 'script', 'facebook-jsddk' )); FB.init ({appId: "myId", Status: true, cookie: true}); & Lt; / Script & gt; Like   

button:
  & lt; Div class = "fb-like" data-href = "myurl.com" data-send = "wrong" data layout = "button_ count" data-width = "450" ​​data-show-faces = "incorrect" & gt; ; & Lt; / Div & gt;    

No comments:

Post a Comment