Whilst Facebook can provide some analytical data on how many visits you get to your Fan Page and they send emails every week (which mostly end up in my spam), the data we receive is not really sophisticated enough. So now a way has been created to track your visitors via Google Analytics.
First of all, this is not my creation, I am merely blogging about it. It was created by www.webdigi.co.uk.
The best way of explaining how it works is to explain how to create it, so I will go straight into it.
Create a New Google Analytics Profile
First thing you need to do is to create a new profile on Analytics, although you must create a profile for a new domain. This will give you a new tracking code which you must note down.
Creating the Facebook Code
Before we continue onto the next part, a little background.
As most people who use it know, Google Analytics needs JavaScript to work. Unfortunately Facebook only allows limited JavaScript so the two are not compatible. Many people have tried to add their Analytics code to their page (including myself) and many people have failed (including myself). So what to do. Well, the clever people at Web Digi have created a free and open source way to convert the Analytics code into an HTML IMG; you can find it at http://ga.webdigi.co.uk/
Simply place the code and Facebook details in the appropriate categories. You will see four categories:
- Analytics Code: - This is where you put the UA number from your analytics code
- Domain on Analytics: – The domain you used for the analytics profile
- Page Link: – Used to let you track the page on Analytics – call it something you will recognise
- Page Title: – For your own reference on Analytics
Once you have placed all of the information in, click generate code, which will give you the IMG code you need to put into Facebook.
Placing the Code in Facebook
Whilst this is possible to do, it can be a bit fiddly (well for me anyway, i’m sure a lot more of you use the Fan Page on Facebook than I do).
The pages that can be tracked are the static boxes that are created created with static FBML. Create as many of these boxes as you like and for each one, add a new IMG file from above. Remember to create a new code for everyone you have.
You cannot add the code to the wall as it is, so create a FBML box just for the wall. Click on Application setting and click [add] to place the box on the wall. This will then track it.
There you have it. 24 hours later you will be able to track your Facebook Fan Page using Google Analytics.
Let us know how you got on or if you ran into any problems.
If you would like to speak to us about our Website Analytics Consulting Services, please contact us.



Brilliant. I had no idea you could add analytics to Facebook,
Thanks for the walkthrough!
Although it is a very interesting post and tip, tracking a Facebook pagae can only be valuable if you have thousands of fans and create regular promotions and marketing campaigns… if you stick with your 200 odd fans , simply use the Facebook stats!
Nice post – very interesting and well written.
One need to have a facebook page with some fans though before tracking them…
I had problems with this and the data did nt seem to work – I will retry to create it.
oups it works now thanks
well no srry guys but I think I am struggling with the FBML bits on Facebook ;(
Yonka,
Did you have any luck with it in the end?
Colin
I am using it , for last 5 months , it can track only one page , as a result you will get to know no of people has visited your fan page not more than that , facebook weekly analytic mail has more detailed insights .