Facebook Page Analytics for iFrame Page Tabs

If your organization is one of the many that’s adding new content to its Facebook Pages using iFrame Page tabs, you might be wondering whether there’s a way to get Facebook Page analytics for visitors to your iFrame Page tabs, within a standard Web analytics tool such as Google Analytics.  The answer is yes — with one notable limitation that we mention at the bottom of the post.

You can add tracking code for tools such as Google Analytics and Clicky Web Analytics to your Facebook iFrame Page, tabs.  However, it has to be done in a slightly different way than you’re used to, as the standard tracking code won’t work.

Facebook Page Analytics with Google Analytics

For Google Analytics, Jason Padvorac, co-developer of Static HTML, suggested the following solution.  You simply need to use a Google Analytics snippet that was created for multiple domains.  This involves adding two lines of code to the standard Google Analytics code:


<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js'type='text/javascript'%3E%3C/script%3E"));</script>
<script type="text/javascript">
try{var pageTracker = _gat._getTracker("UA-12345-1"); // Replace UA-12345-1 with your code
pageTracker._setDomainName("none"); // ** THIS LINE IS NEW!
pageTracker._setAllowLinker(true); // ** THIS LINE IS ALSO NEW!
pageTracker._trackPageview();
} catch(err) {}
</script>

If you add this code to the bottom of your iFrame HTML, you’ll see Facebook Page analytics within your normal Google Analytics views.

Clicky for Facebook Page Analytics

If you use Clicky Web Analytics, you’ll need to add a new Site in order to view Facebook Page analytics.  If you don’t use Clicky, check it out — it provides analyses of your data that you don’t get in Google Analytics.  Also, if your business is B2B, Clicky will provide you with the company name of visitors for which it gets a company match on an IP lookup.

In the Hostname field of a new Clicky Site, enter www.facebook.com. In the Mirrors field, add the URL for your Web host. If you’re using a custom app for your iFrame Page tabs, this will likely be your own domain.  We’re using a third party iFrame app that hosts the HTML code on Amazon S3, so we’ve entered s3.amazonaws.com in the Mirrors field.

Facebook Page Analytics Setup with Clicky

Next, simply add the tracking code for this Site to the bottom of your iFrame Page tab(s).  Then, as visitors hit your iFrame Page tabs, you’ll be able to see the standard visitor information.

Note that if you use Static HTML, which supports multiple Page tabs that are name coded on S3, you’ll have to mentally associate the page number within the path (page_tab2, page_tab3, etc.) with the actual Page tab name on your Facebook Page.  If you use a custom app and your own Web host, you’ll see identifying path names in your analytics.

Facebook Page Visitor in Clicky

 

In Clicky, you’ll also see the standard page detail — in this case, by iFrame Page tab visited (we’ve hidden the visitor name column, since Clicky often displays actual company names).

Clicky Page Tab Detail

The notable limitation mentioned above is that, since the Web page is iFramed by Facebook, that the Referrer is always the same – static.ak.facebook.com/platform/page_proxy.php.  So, you won’t get any useful data on inbound links.

However, if you’re looking for real-time Facebook Page analytics about visitors, inserting code from standard Web analytics tools will provide you with this visitor data.

Schedule Facebook Posts

Posted in: Facebook

Leave a Comment (4) →

4 Comments

  1. Jeff W August 8, 2011

    Hello,

    In regards to the last line of this post, “However, if you’re looking for real-time Facebook Page analytics about visitors, inserting code from standard Web analytics tools will provide you with this visitor data.” – what do you mean by this? Are you saying that using a different real-time analytics provider (such as Chartbeat or any other analytics tool) could provide data on referral pages? Please let me know.

    Best,

    Jeff

  2. Steve Chipman August 9, 2011

    Jeff,

    This was simply concluding text on the apps referenced in the post (Google Analytics and Clicky). I have not researched other tools at this point.

    Steve

  3. Tim Ware September 7, 2011

    Hey Steve,

    Have you tried Jason’s approach? Did it work?

    You’re using GA old-style tracking code. Have you tried the asynchronous version?

    Hope all’s well.

    Tim

  4. Lisa Wills November 8, 2011

    You can also use Google Analytics easily on your Facebook Welcome tab by using http://pholiofy.com. We built it on WordPress as a hosting platform for Facebook Pages custom content and each site is a subdomain of Pholiofy. You just have to set up your Google Analytics for the subdomain and then post the web id into a field in the dashboard.

Leave a Comment