Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7129847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:17:12+00:00 2026-05-28T11:17:12+00:00

Does anyone know when the ChannelUrl parameter, passed to FB.init, is actually used by

  • 0

Does anyone know when the ChannelUrl parameter, passed to FB.init, is actually used by the fb js sdk? I can see it getting hit in our nginx log files and it appears to be from IE8 users, but I cant seem to manually recreate it. I have a Fan Page iframe app, with like buttons and the comment plugins.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:17:12+00:00Added an answer on May 28, 2026 at 11:17 am

    you can see this post. it is well explained.

    https://developers.facebook.com/blog/post/2011/08/02/how-to–optimize-social-plugin-performance/

    this post link may update in future. so I’m copy-paste-ing the whole post from the FB developer blog with giving the full credit to the author.


    How-To: Optimize Social Plugin Performance
    by Ankur Pansari – August 3, 2011 at 12:00am

    Millions of websites use XFBML to render social plugins. We wanted to share some best practices that can improve the performance of these on your websites. Specifically, we offer custom channelUrl and asynchronous loading which, when used, will improve load times and reduce other issues such as double-counting of referral traffic from Facebook.

    The custom channel URL is an optional parameter in the FB.init function called channelUrl. When you initialize the JavaScript library, add the channelUrl parameter in the FB.init function:

    <div id="fb-root"></div>
     <script src="//connect.facebook.net/en_US/all.js"></script>
     <script>
       FB.init({
         appId  : 'YOUR APP ID',
         status: true, // check login status
         cookie: true, // enable cookies to allow server to access session,
         xfbml: true, // enable XFBML and social plugins
         oauth: true, // enable OAuth 2.0
         channelUrl: 'http://www.yourdomain.com/channel.html' //custom channel
       });
     </script>
    

    The channelUrl points to a file that you add to your local directory which helps improve communication speed in some older browsers. Without the channelUrl, we are forced to use workarounds such as loading a second copy of the webpage in a hidden iframe to properly load social plugins. The workarounds increase load times and inflate referral traffic from Facebook.

    To create a channel.html file, add the following line to the file (located at http://www.yourdomain.com/channel.html):

    <script src="//connect.facebook.net/en_US/all.js"></script>
    

    If you have the ability to run PHP, we strongly advise setting a long cache for the channelUrl file to ensure optimal performance. Here is a sample PHP script that accomplishes this:

    <?php
      $cache_expire = 60*60*24*365;
      header("Pragma: public");
      header("Cache-Control: maxage=".$cache_expire);
      header('Expires: '.gmdate('D, d M Y H:i:s', time()+$cache_expire).' GMT');
    ?>
    
    <script src="//connect.facebook.net/en_US/all.js"></script>
    

    In this case, you should also set the channelUrl file to the fully qualified URL such as http://www.yourdomain.com/channel.php.

    In our testing, adding a custom channelUrl improves the performance in Internet Explorer and therefore its inclusion is advised for all of our developers. Internet Explorer yields statistically significant performance gains when including the parameter, where the load time of a test website with 5 XFBML plugins improves from 1.10 seconds to 0.43 seconds.

    Asynchronous loading is another simple tactic that allows your page to load quickly without blocking the loading of other elements of your page. Upon successful loading of the JS SDK, we call the window.fbAsyncInit function. All front-end functions that depend on Facebook API calls should be separated and called via window.fbAsyncInit. This ensures that the Facebook features are loaded in a non-blocking fashion and will speed up its rendering, which has positive SEO benefits. When designing your social features, you should approach it with this mentality to start.

    For example:

    <html xmlns:fb="https://www.facebook.com/2008/fbml">
    <body>
    <div id="fb-root"></div>
    <script>
      /* All Facebook functions should be included 
         in this function, or at least initiated from here */
      window.fbAsyncInit = function() {
        FB.init({appId: 'your app id', 
                 status: true, 
                 cookie: true,
             xfbml: true});
    
        FB.api('/me', function(response) {
          console.log(response.name);
        });
      };
      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>
    </body>
    <html>
    

    We’ve updated our documentation to reflect the importance of these options and changed the default sample code to include a channelUrl. We are continuing to update our docs as part of Operation Developer Love as well as share more best practices via “How-To” blog posts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of any existing packages or libraries that can be used to
Does anyone know where online copies of the old The Perl Journal articles can
Does anyone know how I can, in platform-independent C++ code prevent an object from
Does anyone know how I can implement a single Touch Event. A simple, one
Does anyone know if I can change a m3u8 file dynamically during runtime of
Does anyone know if I can find a list of where the line break
Does anyone know where I can find a tutorial on how to use GStreamer
Does anyone know how i can get the grid to select a row by
Does anyone know where code can be found for Metaphone 3 matching for T-SQL
Does anyone know if I can create an HTML Form to search the DHL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.