Facebook Analytics
- General
Facebook Analytics
The magnified entry of Facebook has refined the world of social media. Nowadays, It has become absolutely necessary to make a Facebook fan page for interacting and communicating with the esteemed client.
Not to be confused with two other buzzwords: Facebook insights and Facebook Pixel.
‘Facebook Insights’ effectively monitors Facebook fan page activities. It is also one of the drawbacks that it is limited to monitor fan page activities only. This data is inaccessible by Google. It comprises the list of visitors, their demographics, age, gender, language, location, etc., based on their Facebook information.
‘Facebook Pixel’ makes conversion tracking, optimization and remarketing easier than ever.
- Track and Optimize Conversions
- Website Custom Audiences
Out of a range of ways, I found the Facebook SDK for Javascript as one of the simplest analytic tools to implement for the web. It provides a rich set of client-side functionality including:
- The use of Like Button and other Social Plugins on your site.
- The use of Facebook Login to lower the barrier for people to sign up on your site.
- Easy call into the Graph API of Facebook.
- Let people perform various actions like sharing stories by launching dialogs.
Basic Setup
The Facebook SDK for JavaScript doesn’t have any standalone files that need to be downloaded or installed, instead, you simply need to include a short piece of regular JavaScript in your HTML that will asynchronously load the SDK into your pages. The async load means it does not block the loading of other elements of your page.
The following snippet of code will initialize the basic version of the SDK. All you need to do is to insert it directly after the opening <body> tag on each page you want to load it into and replace the value in your-app-id with the ID of your own Facebook App.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<script> window.fbAsyncInit = function() { FB.init({ appId : 'your-app-id', xfbml : true, version : 'v2.8' }); 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 = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> |
APP Events – App events are logged with the logEvent and logPurchase methods.
logEvent Method The logEvent method is used to log general events, the details of which are provided as parameters to the method.
1 2 3 4 5 |
logEvent: function( eventName, /* string, required */ valueToSum, /* float, optional */ parameters, /* object, optional */ ) |
logPurchase Method – This one is a dedicated method used for logging purchases and to get data in the revenue section of the analytic dashboard.
1 2 3 4 5 |
logPurchase: function( purchaseAmount, /* float */ currency, /* string, http://en.wikipedia.org/wiki/ISO_4217 */ parameters, /* object, optional */ ) |
You can log different predefined events from the list as well as custom events ( either you can write it by yourself or can get the generated code by specifying parameters ) as per your requirements.
There are basically 3 parameters that you can pass to log an event.
- Event Name: It can be a predefined event or a custom event.
- valueToSum: A valueToSum property is an arbitrary number that represents any value (e.g., a price or a quantity). When reported, all of the valueToSum properties are summed together in Facebook Analytics for Apps. For example, if 10 people each purchased one item that cost $10 (and passed in valueToSum) then they would be summed to report a number of $100.
- Parameter: The list of parameters you wish to pass for that particular event. It can also be standardized one for that event and custom as well.
Access your App Events Report
After implementing all these events, you can see all the data at https://analytics.facebook.com/ then click on Go to Analytics.
Some of the information may be missed out like Gender, Country, Age because of below points.
- The segment you’re using must have at least 1,000 people that are at least 18 years old.
- These people must have been active on Facebook in the last 30 days.
In the dashboard, you can see the active users, revenue, cohorts and funnel ( customer journey through your experience).
Exporting Data
This allows you to export and download your app event data of the last 30 days in a compressed .gz format. To do this, you will need an access token, which you can get either from this url (temporary token) or can use the App_ID|App_secret as an access token. Here are the steps to get data through Export API.
You can also download the data ( .csv ) of a particular section like revenue, funnel, and cohorts by clicking on the right side pointing arrow.
Related content
Auriga: Leveling Up for Enterprise Growth!
Auriga’s journey began in 2010 crafting products for India’s