Facebook Analytics Quickstart Guide for Web

This guide helps you set up Facebook Analytics quickly so you can see data, analyze trends and better understand the behavior of people who use your app.

If you already have the Facebook Pixel installed in your website you can go right to the dashboard and access analytics for your Pixel. See Using Pixels and Event Source Groups for more information.

Before you start

Make sure you have a Facebook Developer account—if you don't have one already, create one.



Create Developer Account

You'll also need to include the Facebook SDK to your app. The following guides take you through all of the necessary steps. When you're done, return here to finish setting up Facebook Analytics.

1. Include the Facebook SDK for JavaScript in Your Web Page

The following snippet of code will give the basic version of the Facebook SDK for JavaScript where the options are set to their most common defaults. Insert the following code snippet directly after the opening <body> tag on each page you want to use Facebook Analytics. Replace {your-app-id} with the App ID of your web page:

<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '{your-app-id}',
      xfbml      : true,
      version    : 'v3.1'
    });
  
    FB.AppEvents.logPageView();
  
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "https://connect.facebook.net/en_US/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>

2. See the Results in the Dashboard

To see events, open Facebook Analytics. Choose your app and navigate to Activity > Event Debugging.
You should see your app launch event. If not, click the refresh button to load the latest events for your app.
Note: Events may take up to 20 minutes to appear in the dashboard.
Once you've verified that your events are being delivered, you're ready to create your first funnel to help you measure conversion for a sequence of events in your app.

Take a Guided Tour of Facebook Analytics

Now that you're logging app events, visit our demo app to take a guided tour of all of the key features that Facebook Analytics offers you and your business.

The demo app does not have an Event Debugging link. This link is only available in apps that you create.

Next Steps

Be sure to check out our other documentation pages for more advanced guides.