Google Analytics for Facebook Fan Pages

We launched our Facebook fan page at the end of last year 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).

Google Analytics ExampleGoogle Analytics Example

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.

Previous Facebook + Outlook = FBLook
Next Got a Question? Ask on Facebook with Questions feature

About author

Jarrett Gucci
Jarrett Gucci 289 posts

Jarrett Gucci is the owner of Dynasty Web Solutions. A full service Internet presence provider specializing in WordPress development for business owners. Jarrett Gucci along with his team of professionals have designed over 400 WordPress websites. Jarrett Gucci believes strongly in creating websites that are unique, functional and generate referrals.

You might also like

Facebook 0 Comments

Facebook Select All Invite or Fanpage Hack/Code

UPDATE: After this post was originally written, Facebook came up with a solution to create lists of friends. You can create several lists, based on your own personal criterias, and

Facebook 0 Comments

Facebook Connect WordPress Plugin

ContentsDownload the latest version here + New Open Graph Social Plugins (V.3.0.6)Download here (V.2.5.2)Download Thesis theme compatibility for (V.1.2.1) Facebook OpenGraph and Social plugins for WordPress (new Facebook Connect plugin):

Facebook 0 Comments

Turn Blog Post into Facebook Fan Page

ContentsWith Facebook’s new Social Graph, you can turn your Blog posts into admin pages.What this means:PrerequisitesOne Response to “Turn Blog Post into Facebook Admin Page”Leave a ReplyJoin Our SiteSearch BlogBlog

Facebook 0 Comments

Install The New Facebook Timeline Layout

VN:F [1.9.22_1171] please wait… Rating: 9.0/10 (6 votes cast) I know, I know. You want to know how to do it. Here’s how: It is SUPER EASY – Just CLICK

Facebook 0 Comments

See All of Your Facebook Share Stats on WordPress

ContentsDomain InsightsHere are the 3 steps needed to setup Facebook Insights on your WordPress website or Blog.Step 1.Step 2.Step 3.That’s It! Replace the area where it says “YOUR_PAGE_ID” with the

Facebook 0 Comments

10 Secrets To Creating Your Brand’s Facebook Presence

Contents1. Build It, And They Might Come2. Establish Your Page with Real Customers3. Talk Like a “Friend”4. Content is King5. World Premiere6. Be Open7. Remove & Report8. Act “Like”able9. Invite

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.