5 Steps To Add A Google Analytics Tab At Your Facebook Page For Regular Web Analytics

by | Nov 13, 2014 | Web Analytics

6 Min Read. |

Google Analytics is a powerful tool to help web administrators to monitor incoming traffic to the website. Using this toolkit, site administrators can get concrete data about visitors. The analytics data is presented across various pivots such as:

  • Number of people who visited the site
  • Number of unique visitors
  • Path chosen by people to visit the site (whether they browsed directly to site or followed a link)
  • Keywords used on search engine to get to the site
  • Duration they stayed on site
  • Click behavior data on site
  • Monitor which webpages are working properly
  • Monitor which webpages are popular

The real power of Google Analytics lies in its ubiquity. The toolkit is available across traditional desktop machines, smartphones and tablets. The tool also tracks social interactions. With this toolkit, marketers can not only get statistical reports about traffic, but also are able to see sophisticated visual representations of the data in form of graphs and charts.

Behind the scenes, Google Analytics generates a page tag or tracking code which is just is a snippet of JavaScript code.  Site owner can add this page tag to every page of the website.  JavaScript needs to be enabled in the browser for analytics to work correctly. When a visitor browses to a webpage, the page tag (tracking code) runs in the client browser, collects relevant data and sends it back to a Google Analytics server.

Digital Marketing Course by Digital Vidya

Free Digital Marketing Webinar

Date: 30th Jan, 2021 (Sat)
Time: 11 AM to 12:30 PM (IST/GMT +5:30)

To better leverage this Google Analytics capability, Facebook introduced iFrame tabs for Facebook Pages. In past, people could build their Facebook Page Tab apps using FBML (Facebook Markup Language). However, with addition of iFrame capability, incoming traffic tracking inside Facebook Page iFrame using Google Analytics became very easy.

Here are five steps that can help you add Analytics to your Facebook Page:

1. Add Static HTML to Facebook Page

  • It is required for you to have a Facebook Account to execute these steps . First, login with your credentials into Facebook.
  • Search for Static HTML in Facebook Search box.

Step 0

  • In the search results you will see an app with name Static HTML: iFrame tabs.

Static HTML

  • Select this app and click on the big blue button with text Add Static HTML to a Page.
  • Choose Facebook Page where you would like to add Analytics.
    Note: It is mandatory for you to have at least one Facebook Page that you are admin of in order to successfully execute this step.
  • As a result of adding static HTML,  you will be able to see an app with text ‘Welcome’ and icon of a star on the Facebook Page as shown in this picture.


2. Edit Static HTML

  • Click on Welcome or Star icon above and click on ‘Edit Tab’, which will take you to edit settings of the App.

Edit Tab

  • After clicking on edit tab, a popup shown in picture below will open up.

Edit HTML Popup

Note: Use Chrome or Firefox for seamless experience with this step.

  • You can continue to edit in popup mode or use Facebook to change the settings.
  • There are two options for editing on this popup: Content and Leadgate (previously called Fangate).

Editing Content:

  • Any standard HTML, text, images or hyperlinks can be added to this section.
  • You can type simple text such as “Hello new visitor”.
  • To commit changes to content, click on blue button with text Save and Publish.

Save and Publish

Editing Leadgate:

  • This option was previously called Fangate; however, as of November 5 2014, Facebook  no longer allows Fangated.
  • If leadgate option is enabled, visitors will see this before they visit the Facebook Page. Main Page content would be displayed after they submit the form.
  • There are 3 ways to edit Leadgate content as shown in this picture.

Edit Leadgate_ Google Analytics

  • To limit the scope of this article, we will use Static HTML editing. This option offers both styled and non-styled copy-pasteable code that can pasted into the content box of Leadgate.
  • Click on Save and Publish button after editing is done.

Digital Marketing Course by Digital Vidya

Free Digital Marketing Webinar

Date: 30th Jan, 2021 (Sat)
Time: 11 AM to 12:30 PM (IST/GMT +5:30)

3. Generate Google Analytics Code:

  • Go to http://wwww.google.com/Analytics
  • Create a new account, if you don’t already have one, by filling up following fields:
  • Account Name : e.g. My Account Name
  • Website Name : e.g. My Website Name
  • Website URL  :  Type http://www.facebook.com for the URL
  • Industry Category : Choose as applicable to you Facebook Fan Page
  • Reporting Time Zone : Choose appropriately

Add Google Analytics Account

  • Uncheck all data sharing options and click on blue button with text Get Tracking ID as below.

Get Tracking ID_ Google Analytics

  • In the next step, you will be presented with Terms of Service Agreement for Google Analytics. Accept the terms to move forward in process.
  • This creates Analytics code in Tracking Info tab as highlighted in the picture below.

Select and Copy Google Analytics Code

  • Select the entire  analytics code, right click and select copy option to copy the script.

4. Paste Analytics code into Facebook Page

  • Navigate to the Content and Leadgate tabs that we worked with in step 3
  • Paste the copied script into index.html for both Content and Leadgate

Paste Google Analytics Code

  • Click on Publish and Save
  • If you preview the tab, you will only be able to see the text and no script code

Google Analytics Preview

5. View Analytics Reports

  • Navigate back to Google Analytics account that you created in Step 4.
  • Change from Admin tab to Reporting Tab of Analytics.
  • Click on Real-Time reporting link on left hand side.

Gogole Analytics Report

  • You can now start seeing data such as number of page views, number of visitors etc. on this tab.
  • Initially there will not be any data on the reporting tab.
  • However, if you visit the Facebook Page and do activities such as clicking on Like button or navigating through page content, after some time Google Analytics will pick up the data and start showing updated reports.

Advantages of adding Google Analytics to Facebook Page

  • Adding Analytics to your Facebook page is real simple, easy, quick and free of cost.
  • Analytics reports can be shared via email and exported to PDF, excel or csv formats for further processing.
  • A reporting dashboard can also be customized by adding selective widgets that are needed for frequent viewing.
  • Analytics offers data on various pivots such as:

1. Real Time

  • Top active pages, top referrals, top social traffic, top keywords and locations
  • Active users
  • Page views per minute
  • Page views per second

2. Audience

  • Sessions, users, pages per session, bounce rate, % new sessions, page-views and average session duration
  • Demographics by country, city
  • System details such as browser, operating system, service provide

Using this rich data, page administrators can develop meaningful insights, perform in-depth analysis of incoming traffic and attract more crowd to visit the page.

Register for FREE Digital Marketing Orientation Class
Date: 30th Jan, 2021 (Sat)
Time: 11 AM to 12:30 PM (IST/GMT +5:30)
  • This field is for validation purposes and should be left unchanged.
We are good people. We don't spam.

You May Also Like…


  1. Ramki

    Thats good. But facebook won’t entertaining UTM tracking

  2. John Abraham

    Good blog Mukta! Very effectively explained of using google analytics for FB!

  3. Mayur

    It works for me!

    Thanks a lot.

    • Digital Vidya Editorial Team

      Hi Mayur,

      Glad to hear that. Could you please share how did it work for you?

  4. Mahmud

    Thank you so much. It works fine for me. My problem is I get real time tracking if someone clicks “welcome” tab of my page. But most cases they browse my page and leave. They don’t click “welcome”tab. In that case analytics doesn’t show any real time visitor. How can I get real time visitor analytics if simply someone just open my facebook page?

  5. Riju Debnath

    Hi Mukta,
    Nice explanation and I tried this method but it’s not working.
    Can you please tell me if it is still working or not.


Submit a Comment

Your email address will not be published. Required fields are marked *