How to Add Google Analytics to a Facebook Page Tab

One of my favorite Google tools (after Google Search, of course) is Analytics. Not only is it free, but there is so much valuable information you can gather about your website visitors from using Analytics; hence the reason why more than 56% of websites that track site statistics use Google Analytics.

If you have a Facebook Page that drives traffic to your website or a client’s website, you could probably benefit from adding Google Analytics to your FBML tabs. This data, combined with the information provided through Facebook Insights, can help you create a more well-rounded idea of where your visitors are coming from and what they’re doing.

Here is a quick three-step process for adding Google Analytics to your Facebook Page.

Step 1: Create a New Profile in Google Analytics

Assuming you already have a Google Analytics account, the first step is to add a new profile for the Facebook tab you want to track. If you don’t have a Google Analytics account yet, you’ll need to create one to get started.

Since each FBML tab on your Facebook Page has it’s own unique URL, you can add separate Analytics code to each custom tab. We’ll do just one FBML tab in this tutorial.

Go to your Google Analytics account and click the “Add new profile” link.

On the next screen, select “Add a Profile for a new domain” and paste in the full URL for your FBML tab. It will look something like this:

www.facebook.com/YourFacebookPageUsername/?v=app_999999999.

Then click “Continue.”

Step 2: Add Tracking Code to FBML

The next screen will give you the tracking details; we are most interested in the Web Property ID, which looks something like: UA-9999999-9. Keep that line handy.

Next, you are going to go back to your Facebook Page and edit the FBML for the tab you want to track. To do this:

  • Click the “Edit Page” link under your profile image
  • Click “Applications”
  • Scroll to the FBML app you have already created for your Page
  • Click “Go to Application”

Copy the code below, and replace the UA-9999999-9 with your Web Property ID code as shown above. Then, paste the line at the bottom on your FBML code and save your changes.

<fb:google-analytics uacct=”UA-9999999-9″ />

Step 3: Check Your Stats

Once you’ve completed the two previous steps, go back Google Analytics, click “Finish,” and you will see your tab URL listing with a “Tracking Not Installed” icon: . It can take up to 24 hours for the tracking to kick in. You’ll want to come back to this page in a day or so to confirm it is tracking correctly.

If you plan to add Google Analytics to more than one tab, you will want to rename the tab in Analytics to make it easier for you to keep track. Click the pencil icon to the right of the field and enter a new nickname for the page.

And that’s it. The statistics generated and activity tracked will depend on what type of content you have on your FBML tab, but you will be able to see daily pageviews at a minimum.

Do you track your Facebook Page visitors using Google Analytics, Facebook Insights or something else?

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • aaronwherd

    This is fantastic. Thanks for not only showing me how to add this to our pages, but for leading me to FBML tabs.

  • Phil

    This is awesome. I had been searching all morning for a way to do this for my Business Facebook page. http://www.officeanything.com

  • srilatha marru

    Thanks for the information. Its good to track the detailed analytics of facebook tab from google analytics tool. Nice stuff.

  • plaudit_design

    Very nice step by step guide. Great job.

  • goldfidget

    That’s actually quite good. How nice of Facebook to implement an fb:google-analytics tag.

  • Linda

    This is a really good idea, even if facebook fan page has the insight, google analytics is much better
    thanks for the post

  • c_spha

    Thanks A lot I have a friend who has been asking me about this for A while now i will certainly recommend this article matter of fact I’m sending him this link right now !.Very nice

  • Dan Soschin

    Thanks for sharing. I’m a Google Analytics supporter/user/evangelist and this is a fantastic tip. I’m wondering how many other virtual sites out there we might be be able to configure in a similar manner!

  • Anil Gupta

    Just added Google Analytics for my facebook fan page http://www.facebook.com/SFMBlog, lets see how it goes

  • Anil Gupta

    Hi

    I’m not getting anything against my fan page in my Google analytic even after 36 hours. Its still showing tracking not installed for my fan page I shared previously. I added the analytic code in Div tag with the rest of HTML code before the closing of Div tag. Am I making some error?

  • http://thehawk.wordpress.com HAWK

    According to the blog post you put the tag right at the bottom – so I’d put it outside the div tag and see how you go.

  • http://fcOnTheWeb.com ferrari_chris

    Thanks! I just added this to our Facebook page tabs, so I await the response with anticpation.

  • http://www.waterfallweb.net/ RockyShark

    Has anyone got this working?
    I copied the example line of code from above, updated it with my GA number, and it’s still not working.
    Oddly enough, if I check the source code for my StaticFBML page, the tracking code isn’t there, which according to this reference, it should be:
    http://developers.facebook.com/docs/reference/fbml/google-analytics

    • http://fcOnTheWeb.com ferrari_chris

      That’s a good point. I just checked our analytics page and it still says “Tracking not installed”… Hmmmm.

  • http://www.avertua.com Alyssa Gregory

    Hmmm…not sure what’s up. My tracking from a while ago is working, but I’ll set up a new tab and test it again in case something is amiss.

  • User

    It’s Not Working.

  • http://twitter.com/Nayan_shrimal Nayan Shrimal

    It’s completely west of time. This way is not working

  • http://twitter.com/Nayan_shrimal Nayan Shrimal

    It’s completely west of time. This way is not working

  • http://www.strikespots.com/ Adam

    I think this may be outdated. I just tried it myself and nothing happened.

    The FBML tab is there, but the actual Analytics code isn’t.

  • http://frwiends.com/facebook frwiends viral fans pages

    Thanks, you have saved me a lots of hours. I have been trying to install this for long.