FB.Event.subscribe('edge.create', function()) trigger works with Link button but not with Link box

I’ve created two test pages, one with a Facebook Link button and one with a Link box.
When somebody clicks “Like” I want an image pixel to be fired so we can pick this up from the web server logs.

It works just fine with the Like button but for some reason not with the Like box. Both Like plugins are included as XFBML versions.

  • Facebook API: Login using JavaScript SDK then checking login state with PHP
  • Facebook like and share button with callback
  • How could I change window's location without reloading and # hack?
  • SecurityError from Facebook and Cross Domain Messaging
  • Tag friends on post and location with javascript api
  • Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin ('null')
  • The code I am using for both when it comes to triggering the pixel call:

    <div id="fb-root"></div>
    <script type="text/javascript">
    <!--
    
    window.fbAsyncInit = function()
    {
        FB.init({
            appId: '{{appId}}',
            status: true,
            cookie: true,
            xfbml: true 
        });
    
        FB.Event.subscribe('edge.create', function(){
            var tracking_pixel = new Image(1, 1);
            tracking_pixel.src = '{{image_pixel_url}}';
        });
    };
    
    (function(d){
        var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
        if(d.getElementById(id))
        {
            return;
        }
        js = d.createElement('script');
        js.id = id;
        js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        ref.parentNode.insertBefore(js, ref);
    }(document));
    
    // -->
    </script>
    

    I have also declared:

    <html xmlns:fb="http://ogp.me/ns/fb#">
    

    Any suggestions are appreciated!

    Thanks in advance.

    /Marcus

  • Facebook comments loads very slow
  • Detect when Facebook Like Button is loaded
  • “Failed to load resource” using Facebook's example code
  • When is auth.authResponseChange, auth.logout etc. fired? Safari and Firefox behave different
  • Facebook Open Graph Single Page Apps
  • Requiring extended permissions with the JS SDK without necessarily using FB.login()