I'm getting lots of querystrings added to urls on my site, all of the form ?fb_xd_fragment
According to the FB.init docs at http://developers.facebook.com/docs/reference/javascript/FB.init/ they've added the ability to have a custom channel url which is meant to solve 3 specific issues:
1. When auto playing audio/video is involved, the user may hear two streams of audio because the page has been loaded a second time in the background for cross domain communication.
2. If you have frame busting code, then you would see a blank page.
3. This will prevent inclusion of extra hits in your server-side logs.
I'm seeing those hits, and would prefer not to. It would be easy enough to add the following to FB.init:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId : 'YOUR APP ID',
channelUrl : 'http://example.com/channel.html' // custom channel
});
</script>
The contents of the channel.html file should be this single line:
According to the FB docs, not adding the channelUrl parameter means you should remove the following from your logs to ensure proper counts:
1. Matches against user-agent: "facebookexternalhit/*"
2. Pageviews containing "fb_xd_bust" or "fb_xd_fragment"
3. Track clicks from FB-hosted iframes separately from referrers (http://www.facebook.com/plugins/ http://www.facebook.com/plugins/like.php
Adding a channelUrl to fb_social would be pretty easy - but I wanted to check the maintainer thinks this is a good idea before I submit a patch?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | custom-channel-url-1177776-4.patch | 1.89 KB | burningdog |
Comments
Comment #1
ferdi commentedSounds good. If you submit a patch, that would be great. Do you have any idea how we would cache the channel page ?
thanks!
Comment #2
burningdog commentedI'm not sure how we'd cache the channel page, but I'll look into it.
Comment #3
ferdi commentedThis seems relevant ? http://drupal.org/node/909910
Comment #4
burningdog commentedThanks - I've already read that. The comment at #14 on that thread is actually the fix that I'm proposing :) So, on with the patch, which is attached.
I've added 2 headers to the custom channel url, which is now available at www.example.com/fb_social/channel
The numbers for s-maxage and max-age are the number of seconds in one year, and the Expires date is when I turn 100 (!).
Comment #5
burningdog commentedChanged status.
Comment #6
burningdog commented*nudge*
Comment #7
ferdi commentedCommitted, http://drupalcode.org/project/fb_social.git/commit/5bb9765
thanks!
Comment #8
ferdi commentedComment #9
burningdog commentedw00t! Thanks, ferdi :)