Google Analytics for Facebook Fan Pages
We launched our Facebook fan page earlier this month and as with all Facebook pages only Facebook Insights program is available to page administrators. Facebook Insights shows demographic details and interactions on your pages BUT limited to show information of fans only. It is far less sophisticated and comprehensive when compared to the free Google Analytics. One of the limitations of Facebook Fan pages is that you can only run limited Javascript on it and Google Analytics needs Javascript code included to correctly track visitors. We have successfully managed to get ALL functions of Google Analytics working on our Facebook fan page (including visitor statistics, traffic sources, visitor country, keyword searches with all other powerful reporting & maps overlays etc).
How to setup Google Analytics on your Facebook fan pages
The workaround we use in our code is to include Google Analytics as an image instead of setting the standard Javascript. This method tracks every visitor to the custom facebook pages on Google Analytics. It required a combination of server side cookie management and an additional <img> tag to the bottom of the facebook fan page. Here are the steps to get Google Analytics working on your facebook fan page.
1) Setup Google Analytics account. If you already have one, create a new website profile. You can name it facebook.com or facebook.com/your_page_name. You will finally get your tracking code which looks like this UA-3123123-2
2) Create your custom img tag for each of your pages you like to track. EG: contact form, services, products etc. You can use our tool to create the Google Analytics link generator for Facebook pages.
3) Add the entire custom image html tag from step 2 to the bottom of each Facebook fan page that you need to track.
That is all there is to it! Google Analytics is not real-time, so you will need to give it some time. Approximately a day before you see the fruits of your “hard” work.
For advanced users
Use this method, if you don’t want to use our hosted link redirection as mentioned in the method above. You can download the entire source code which is just about three files to get this setup working on your own server (running PHP4.3 or above). The code is written in PHP and essentially creates the Google image tracking URL with the referrer, page information, ID, etc. The additional advantage of hosting this on your own server and domain is that visits from your website to your facebook fan page gets tracked, etc. You will also be able to customise further if you wish. Please do share any useful updates you apply to the tracking link code.
Facebook – Google Analytics Tracker v1.1 (Updated 21st Feb, 2010). For advanced method – Download this code to use on your server.
If you don’t have a Facebook fan page yet, visit our tutorial for code and help on creating customised Facebook fan pages.
PS: We could not find any other source / blog that described how to get Google Analytics on Facebook fan pages! There is support for canvas pages and applications but nothing for StaticFBML fan pages. Hope this helps and please leave your comments below.
UPDATE:
1) A lot of users have asked how to track visits to the wall. Yes, this can be done. Please see the comments by iphp below.
2) Here is a screenshot to a staticFBML where the code should be placed
3) We have managed to set up funnels, goals and segments to separate fan and non fan activity.
4) Video: Here is a link to the Webdigi youtube channel check our favourites to get step by step walkthrough!
5) This blog and comments cover all aspects of setting up Google Analytics. If you still want help, we are available to offer paid support and installation of Analytics for your page. Please contact us here.
I´ve installed the tracking code in my client page and it works perfectly!
My doubt is in GA the information about “time on site” is 00:00:00 and you said that this info is working.
Any issues with that?
facebook/animalebrasil
TKS!
Does the advanced method (i.e. installing on our own web server) allow tracking of referral paths other than just referrals from our own website? I.e. can this method be used to track what other websites referred visitors to our Facebook page?
Pingback: Tracking Hosted Wordpress Blogs With Google Analytics « Si Quando Dubium, Illic Est Scilicet
Pingback: Designing A Facebook Fan Page: Showcases, Tutorials, Resources - Smashing Magazine
Pingback: Designing A Facebook Fan Page: Showcases, Tutorials, Resources | Web Design Cool
Great Blog post!! I just did this and it was easy as pie!! thanks for the info.. I will pass this on !!
Joanne DelBalso
@nofussacctng
Hi, great job!
Can I use fgba for tracking email marketing campaign?
It’s seam that’s possible… it’s like the classic gif insert method
Domain on Analytics: mydomain
Page Link: alternate-webpage-url-of-email-HTML/newsletter-date.html
Page Title: newsletter-date
[don’t need GA-code in the alternate page, keep the img gif code]
Thanks you very much, very usefull
Regards
@dmsr
Thanks for sharing!
Cheers,
Stuart
Thanks a lot for this I followed your directions and I am getting the “Tracking Not Installed” error code, I will give it some time and see if it starts working. Once again great blog post and thanks
Chris
@lifterCatcher
Here is the link to my fan page to hope to get some clicks to see if this is working.
facebook.com/pages/Our-Fitness-Journey/158321227279?v
Update: after a couple more hours, the GA registered the feed. I’m anticipating my first daily report in an hour!
Thanks again!
Hi,
I have tried this over and over and I guess I’m doing it wrong because I still can’t get the reports to start. Here is what I have been putting into the FBGAT code generator:
Analytics Code: Check, I have that.
Domain: facebook.com/wsuspokane
Page Title: This is where it’s confusing. I don’t know whether to put “WSUSpokane” (the fan page name) or “Cougs” (the name of the box the code is in).
Page Title: This is confusing as well, page or box?
Any help would be appreciated, but it doesn’t look like you are answering comments anymore. 🙁
Cat
@ iPHP, though it might seem logical that using fb:google-analytics on a canvas page would be applicable on a profile tab, too. Hopefully, I can save someone some headache, or maybe they could tell me what I’m doing wrong. But your tracking method worked, and I said no more need to beat my head against the wall.
@Chris, @Stuart, @Nate, @Joanne, @Hubert.
THANKS! Thank you for your comments. I hope this encourages people who are nearly there with integrating Facebook to
@Cat C.
Sorry for the delay in replying. We have been really busy. I hope you have already figured out the issue. Can you please post the link to your facebook page? Page Title does not matter, it is just to help you identify the page when you see the reports.
What a great solution. I’d like to try it out, if anyone can give me a hand just by visiting the page so I can see if it tracks in a few hours. Thanks again!!
facebook.com/shotinthedarkmysteries
🙂
Leigh Clements
Shot In The Dark Mysteries
Heads up, FB is killing boxes = no more GA for the Wall. Anything in the works from Webdigi?
Thank you for all of your help. I’ve been able to set up analytics on the Wall of my page and am tracking visits, but so far the Overlay function doesn’t seem to be working. Is there anything special that needs to be done to set it up?
Thanks!
Thanks to your post successfully implemented Google Analytics to our fanpage’s wall. So far it has been working perfectly!
Dear iphp,
Thanks for the tutorial. It works everywhere except on my wall.
I put the code in a FBML with some other info so that the box would show up.
Under Application Settings I removed the tab and added a box.
But the next step:
“Once a box is added it will be displayed under the Boxes section. All you have to do is to click on the little edit icon and select “Move to Wall”.”
I dont know where i can find that. can you discibe this some more? Maybe add a screenshot?
Thanks!
ah amazing! I didn’t know we can use Google Analytics for Facebook Fan page!
Now I will try to use it!
Thanks to your post successfully implemented Google Analytics to our fanpage’s wall. So far it has been working perfectly!
Great followed the tutorial step by step yesterday and it works perfectly on all pages & wall for me!! Thanks you guys are amazing!
Facebook is planning on removing boxes from profiles. I know the code will still work on the tabs but do you have a solution for tracking wall visits without boxes?
It all makes sense up to step 3. I don’t know how you just put an image at the bottom of a page on facebook, I have no control of the layout of facebook, or editing the html. I need a bit more explanation of that step please.
A-W-E-S-O-M-E thanks for offering this to the open public.
Question, can I somehow pass custom “user variables” to GA? Whether using the hosted version or tweaking the self-hosted?
Thanks!
@Leigh, @Beate, @Isan, @Jenni
Thanks for taking your time to comment on your success. This will certainly encourage people who are getting started.
@Aimee
To put an image on the bottom of a page on Facebook, you need to setup Static FBML to be able to do this. This is how your staticFBML page will look like. webdigi.co.uk/blog/wp-content/uploads/2009/06/adding-img-tag.png
@Hector, Absolutely, you can pas your custom user variables to GA. You have to tweak the self-hosted version. Please keep in mind that all you have to do is to generate the correct URL and things should work. Please let us know if you manage to get additional analytics information, we can probably add it back into the hosted version for the public.
Thanks! Will definitely share it back if we get it working. Again, thanks for sharing this with everyone.
🙂
Pingback: Smashing Magazine: Designing A Facebook Fan Page: Showcases, Tutorials, Resources « Facebook applications for developers
Pingback: 8 Things You May Not Know About Facebook «
Pingback: 8 Things You May Not Know About Facebook - OCSEA
Pingback: How to install Google Analytics on your Facebook Fan Page « MARKETING STRATEGIST
@ipha –
How are you able to track wall visits now that boxes have been disabled?
Thank you very much.
Dear iphp, I’ve read all this blog and there is excelent information. Thanks, but I got an issue, when you posted before that to track the Wall you need to add a staticFBML to the wall changing the settings adding a box and remove tab is where the troubles comes up. When I go to settings only the TAB configuration to add or remove appear, nothing about to ADD BOX only to add or remove TAB. How can this be configured or changed?
Thanks!
Pingback: 8 Things You May Not Know About Facebook
Screencast: How to Add Google Analytics to Your Facebook Fan Page
craftyman.net/google-analytics-facebook/
Facebok got rid of the boxes!
Is there a way to track the wall now?
I don’t see any!
Please deny me 😀
Thanks for sharing this. I knew it was just a matter of time.
Is there a way to track fanpage Wall (as BOXes are no longer available)?
Hello,
This article is really interesting. Thanks for sharing this tips.
But I still have a problem for tracking the wall activity.
How do you do to put the code on the wall since Facebook remove the box?
Have you fin a work around?
Tx for answering.
Have a nice Day,
Ben.
Hi, It seems it’s no longer possible to create a box for FBML pages I only have the option to add the page as a new tab. Is there any other way to tag my wall without using boxes? cheers, Rudi
Pingback: links for 2010-09-14 « Stevens Media
Now Facebook does not allow to customize the wall. How can I put the code?
Pingback: The Purposeful Techie » Blog Archive » Facebook and Google Analytics
Hi guys,
seem like facebook has disabled the box option in fmbl so I am not anymore able to post the code on the wall. Is there any workaround to it? Thanks. G.
I wonder if it would be possible to put the IMG tag as your profile pic?
Perhaps I am dumber then I actually think I am.
Hi, I’ve read everything in this post, very useful. The issue I got is the need to track the wall in Analytics, I’ve read that changing the settings of the static FBML to ‘Add Box’ and ‘Remove Tab’ but in my settings it does not appear, only appears ‘Add / Remove Tab’ how can this be done. Any help is very appreciated and thanks for saring this with the world.
Thrilled I found GA solution. I totally understand where to embed Your generator code on page(s).
Server side upload: would that be the actual GA code generated by Google or
the one that I got from your Generator?
Please Advise 🙂
Where do I paste the code? I need help.
Facebook has removed the Box. Does this mean we can no longer track the Wall? Or I’m missing something?
Thanks!
Hello,
Have you found a new way to track FB pages with Google Analytics now that FBML boxes are no longer available on FB ? I’d be very interested to know !! 🙂
Thanx
guys is it possible to Modify the script to work with Other Analytics Providers ? I don’t want use GA
Pingback: 8 Things You May Not Know About Facebook -XTmotion-Web Development, Web design & Digital Marketing Blog
Pingback: El código fb:google-analytics no funciona en Fan Page de Facebook | UnosTips.com
Somebody please tell me is it possible to do same thing but for user profile at FB?
Excellent tip. Any new solution for tracking wall visits now that Facebook got rid of boxes? Thanks!
I was trying to add analytics for facebook pages but couldn’t completed the process please show the step by step procedure for this…
thanks
Pingback: Few Web Insights – eMarketinGuide.com | Top 10 Google Rankings
Pingback: How to setup Google Analytics on your Facebook fan pages | LaDart Creative Inc.
Thanks for sharing the info. its nice to see a proper replacement to Facebook insights for ages.
Pingback: Google Analytics – Statistiche per facebook | Robots.txt: User-agent: * Disallow: /
Hi,
I was wondering why you’re working with: utma, utmb, utmc and utmz. If I use your script within my tab-app Facebook doesn’t track referals either, do they?
@Fabian Once setup correctly google analytics tracks referals, country, visitors and you can even set in-page analytics (new feature on google analytics). In short it should work just like google analytics on any web page / website.
@php-manual: Thanks, I tried to refactor and improve this whole thing and I don’t understand these lines, but i ll try to implement them either.
What’s with this comment? Did you fixed this?
// Problems with duplicate array keys here!
Pingback: Add Google Analytics Tracking to Facebook | Gabe Kassel
It seems I need some help! And I seem to have lost some of the pages with instructions and don’t know where to go to get them…
Dudes, can you please contact me for merging our sources.
Pingback: 5 Facebook Advertising Tips | the steer blog
cool
this really works!!!!!