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.
Here is the link to FBGAT on Github (use this to track updates, file bugs, ideas, etc)

* 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.

40 Comments

Steve C.
Mar 25, 2010 at 2:11 am

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?


 
iphp
Mar 25, 2010 at 8:02 am

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.


 
vamsee
Mar 25, 2010 at 9:08 am

Good initiative…keep up the good work!!!


 
Barbara Feldman
Mar 25, 2010 at 3:00 pm

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!


 
iphp
Mar 25, 2010 at 3:24 pm

@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.


 
How to Add Google Analytics to Your Facebook Fan Page | KDI Media
Mar 25, 2010 at 3:55 pm

[...] 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 [...]


 
Track your Facebook Page with Google Analytics
Apr 7, 2010 at 12:58 pm

[...] FBGAT is is a free tool that can generate a the code necessary to bypass the Javascript limitations on Facebook. [...]


 
How do I set up Google Analytics on a Facebook fan page? | Ask Owen
Apr 16, 2010 at 9:21 pm

[...] down to FBGAT – The FaceBook Google Analytics Tracker. You can download and host your own version of this [...]


 
Joe
Apr 21, 2010 at 10:58 pm

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?


 
Amit
May 14, 2010 at 2:10 pm

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


 
Tracking Facebook Fanpage Stats « UPSU Marketing
May 19, 2010 at 8:47 pm

[...] 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 [...]


 
Google Analytics for Facebook « Games Women Play
May 20, 2010 at 6:52 pm

[...] 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 [...]


 
James Moreira
May 30, 2010 at 11:11 pm

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?


 
Akar Jonas
May 31, 2010 at 11:53 am

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.


 
maya
Jun 7, 2010 at 4:00 pm

When i download the FBGAT v 1.1 it only shows me picture icons and no files. Help


 
iphp
Jun 7, 2010 at 4:36 pm

@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/


 
Facebook Best Practices for Nonprofit Organizations « Planeta Feliz's Blog
Jul 7, 2010 at 4:04 pm

[...] 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 [...]


 
Peter
Aug 4, 2010 at 3:07 pm

This is really excellent! Thanks for sharing!!


 
Suranga Rajakaruna
Aug 10, 2010 at 1:10 pm

I have external links on my facebook page. Is there any way to track how many visitors clicked on those links ?


 
iphp
Aug 13, 2010 at 9:57 am

Yes, you can track external links on your facebook page. You will have to use the onclick function. Please take a look at this article http://www.webdigi.co.uk/blog/2010/tracking-user-engagement-on-facebook-fan-pages/


 
How to Add Google Analytics to Your Facebook Fan Page | Ben's Mind Dump
Aug 16, 2010 at 1:11 pm

[...] 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 [...]


 
Setting up and Analyzing Google Analytics for Facebook Fan Pages | Microreviews.org
Aug 17, 2010 at 4:51 am

[...] Facebook – Google Analytics Tracker v1.1 (Updated 21st Feb, 2010).  For advanced method – Download this code to use on your server. [...]


 
Stephane
Aug 22, 2010 at 4:28 pm

Hi,
I am looking at the code you are putting in static FBML and seeing that you are basically declaring an with a ref to an external PHP source.
I am trying to do the same thing to a script that either returns a pixel, either returns an image based on various conditions that live on my server but it doesn’t seem to work. Any ideas?
Thanks in advance!


 
How to Add google analytic on your Facebook Fan Page | VullpixMedia
Oct 10, 2010 at 10:27 am

[...] 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 [...]


 
Toph
Oct 25, 2010 at 4:31 pm

Thanks!

I admin about 12 different brand’s fan pages, and this is an easy, essential work around for my Static FBML tabs.


 
How to Integrate Google analytic with Facebook Fan Page
Oct 26, 2010 at 7:19 am

[...] Analytics with your Facebook page is really simple and the plugin that makes it simple is called Facebook Google Analytics Tracker. Here is a quick tutorial describing how to integrate Facebook Fan page with Google [...]


 
Sarah
Oct 26, 2010 at 10:40 am

Hi, I’m trying to set this up on a friend’s page – came across you via shoutmeloud.com/how-to-integrate-google-analytic-with-facebook-fan-page.html

I’ve uploaded files to his server, however, when I put in the url to where it’s located I get this error: A file permissions error has occurred. Please check the permissions on the script and the directory it is in and try again.

What should the file permissions be set to?
Thanks for your help :)


 
php-manual
Oct 29, 2010 at 2:18 pm

@Sarah – Please try and change the folder permission to 777, that is most likely to solve the problem!


 
Add Google Analytics to your facebook fan page « asiaweekend
Nov 6, 2010 at 10:58 am

[...] 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 [...]


 
Google Analytics for Facebook Fan Pages « Josephbryanmedia's Blog
Nov 18, 2010 at 3:17 am

[...] Facebook – Google Analytics Tracker v1.1 (Updated 21st Feb, 2010).  For advanced method – Download this code to use on your server. [...]


 
Sushilver
Dec 2, 2010 at 6:13 am

I like the whole idea and finally i am happy because this javascript code will help us to track all our facebook fan pages.

thanks to share with us your innovative thoughts.


 
Track Your Facebook Fanpage Visits Using Google Analytics. « Mahesh Narayanan
Dec 10, 2010 at 6:44 pm

[...] to include Javascript code into the fanpage. Now here is a solution i.e create a custom image using FBGAT. FBGAT (Facebook Analytics Tracker) is an Opensource that can help you create a custom image code [...]


 
Optimize Your Facebook Page | Single Grain Blog
Mar 10, 2011 at 5:20 pm

[...] add a typical Google Analytics tracking code to your Facebook page. The free, opensource tool Facebook Google Analytics Tracker (FBGAT) allows you to add your tracking code within an img tag that Google will recognize. For a [...]


 
15 Free Tools To Monitor Social Media Influence of Your Brand
Jun 13, 2011 at 3:31 pm

[...] 4. FBGAT (Facebook Google Analytics Tracker) [...]


 
Add Google Analytics to Your Facebook Fan Page « Niranjan,s Web Blog
Jul 8, 2011 at 5:24 am

[...] 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 [...]


 
Facebook fan page tracking
Nov 20, 2011 at 6:58 pm

[...] suggest using the a free program called FBGAT (Facebook Google Analytics Tracker) that allows Google Analytics to work on your Facebook page. Now you can have accurate statistics of [...]


 
Track Your Facebook Fanpage Visits Using Google Analytics. | Social Media, SEO & Web Analytics Updates
Dec 19, 2011 at 6:49 am

[...] to include Javascript code into the fanpage. Now here is a solution i.e create a custom image using FBGAT. FBGAT (Facebook Analytics Tracker) is an Opensource that can help you create a custom image code [...]


 
Stables For Sale
Dec 22, 2011 at 2:40 pm

Thanks for a great article. :)


 
indir
Dec 27, 2011 at 3:58 pm

Thank you very much, it’s realy helpfuly article (for me!). :)


 
Danny
Jan 23, 2012 at 3:35 pm

Thank you for the valuable tool.

Unfortunately FBML is no longer functional as of June 2012….
https://developers.facebook.com/docs/reference/fbml/

Is there a recommended alternative?


 

Reply

Copyright © 2012 PHP, Web and IT stuff All rights reserved. PHP Web development in London.