FBGAT – Facebook Google Analytics tracker
FBGAT is a free and opensource tool created by Webdigi to work around Facebook’s Javascript restriction on Facebook fan pages which prevents Google Analytics from working correctly. There are two key parts to this tool.
1) The code generator: This helps users generate a code for each individual areas that has to be tracked on Google Analytics
2) The tracker: This instructs Google Analytics on each page load to log visits, IP address, browser, country, etc.
Here are general instructions on how to setup Google Analytics on your Facebook pages.
The hosted version
The hosted version of FBGAT is free to use (no plans to charge for usage). We will try to keep this up-to-date with improvements we make and will try to ensure that it runs without any downtime. We also relying on this server to track our Facebook fan pages. However, there are no guarantees of any sort that this will also be available. If you are more comfortable hosting your own version of FBGAT. Please feel free to grab a copy and run it on your server.
To download and setup on your own server
You will need an externally accessible webserver running PHP to install FBGAT and run it by yourself. There is nothing to configure and there is no requirement of a database, etc. Please feel free to share your ideas back to us and back to the community at large if you make any improvements.
FBGAT Download
Version 1.1 (download) released on Feb 22, 2010.
* You are free to do whatever you want with these files, respecting other licence agreements. We have seen Chinese and German translations of this tool popup. We would be happy if you could link back to our original work but that is also entirely your choice.

I’m attempting to use this free service, which by the way i appreciate. However, the instructions are a little vague. I’m installing this on my own web server btw. Is there a certain directory these files need to be uploaded to. Also, how do I run it?
This page was not intended to give out instructions. This is the central area for file updates and news on FBGAT. Here are the instructions:
1) How to setup Google Analytics for Facebook pages
2) View Fan/Non-Fan visits, Funnel visualisation, Goals, Tracking page activity
@Steve, you don’t have to upload FBGAT into a specific directory. Just upload it anywhere and then use the link generator.
Good initiative…keep up the good work!!!
I’ve uploaded the scripts, and started to test them. However, when GA showed no traffic, I tried to load one of the created tracking images in a browser.
I am getting an Parse Error, Galvanize.php on line 23 when testing the img in a browser. I am using PHP 4.3.8
Any thoughts?
Thanks!
@Barbara, you will need to use PHP versions greater than version 5 ideally. This is because it uses PHP classes and the public and protected access modifiers work only in PHP 5 or greater.
[...] there is a new solution. Using free and opensource FBGAT (Facebook Google Analytics Tracker), you can get Google Analytics working on your Facebook fan page. Now you can track visitor [...]
[...] FBGAT is is a free tool that can generate a the code necessary to bypass the Javascript limitations on Facebook. [...]
[...] down to FBGAT – The FaceBook Google Analytics Tracker. You can download and host your own version of this [...]
I don’t have access to php version 5. I tried to change the code to work on php4 and I get it to work, but unfortunately I haven’t seen a single hit come through on Google. Matter of fact in Google they’re still showing a yellow icon instead of a green one.
Can you suggest anything?
hey, i have the code on my server when i generate the link and add it to my facebok page i get an x for image. What am i doing wrong? if i add the code for hosted version it works fine
Thanks
[...] there is a new solution. Using free and opensource FBGAT (Facebook Google Analytics Tracker), you can get Google Analytics working on your Facebook fan page. Now you can track visitor [...]
[...] lies behind this is a little tool called FBGAT. FBGAT is a free and opensource tool created by Webdigi to work around Facebook’s Javascript [...]
I got the code, but where do I put it on my site? where do i enter it? I realize I have FBML but, isn’t that only for tabs? or pages within?
Thanks for the wonderful tip. I managed to follow the instructions in detail and setup my first user interaction tracking. I cant thank you enough!
This method works beautifully with facebook pages and google analytics.
When i download the FBGAT v 1.1 it only shows me picture icons and no files. Help
@James, please read the original article here http://www.webdigi.co.uk/blog/2010/google-analytics-for-facebook-fan-pages/
@Amit, I think you have a different version of PHP, we need versions above 5.
@Akar Jonas, Excellent!
@ maya, you need to upload all the files to your server to setup your own hosted version. The code files are in there with extension php, js, etc. You can also use the hosted version as described here http://www.webdigi.co.uk/blog/2010/google-analytics-for-facebook-fan-pages/
[...] people visit your Facebook Page, then sign up for a free Google Analytics account. Next download FBGAT. Then follow the steps here to add the tracking code to your Facebook Page. Basic HTML knowledge is [...]