How to add google analytics code to facebook page

How to add google analytics code to facebook page

  • Firstly Google Analytics account is needed.
  • Once Google Analytics account is created, or if there is already a Google Analytics account, you need to create a new profile. This is done by going to the “Analytics Settings” page, and clicking “Add Website Profile” in the lower left hand corner.
  • Use the URL of your Facebook Page – i.e. facebook.com/youfacebookfanpage
  • Press the “Finish” button and will then be taken to a page where you will find your javascript code.  Within this code you need to find your custom Google Analytics profile id – i.e.
    Format UA-1111111-1
  • Now we can create the image file that will be used to add to each of section of your Facebook Fan Page that you want to track via Google Analytics. Make sure for the Analytics Code: you only use the UA-XXXXX-XXX portion of your Google Analytics code.
  • Copy the entire image HTML code and paste it into the bottom of the FBML app for each tab you want to track in your Facebook Fan Page.