Designing Your Data

The key to maximizing the effectiveness of Facebook Analytics is by sending aggregated and anonymized data so that you can learn about the behaviors of your users. By starting with accurate data, you can develop a solid understanding of you users. This topic shows you a systematic approach to designing and implementing accurate data to send to Facebook Analytics.

Steps

Sending accurate data starts with a plan that includes the goals of your website or mobile app. Here is a list of steps to systematically design your data to meet your goals.

  1. Define Success - what does success means in your app or web page?
  2. Define the Route to Success - what are the steps that a user has to take in order to achieve success in your app.
  3. Define the Data to Measure the Route To Success - how to quantify each step of the route.
  4. Implement the Data - implement the data in your app or web page.

Define Success

In this step you will determine what success is for your website or mobile app. You want to define the goals of your website or mobile app. For example, the goal of the an e-commerce business that uses a website or mobile app to sell product is to ship a product that a customer selects.

If you have several goals, go through the steps for each goal. When you have the steps for all of the goals, you can then combine common steps to make implementation more efficient.

Define the Route to Success

In this step you will determine the steps your user will take to get to the goal of your website or mobile app. You need to define two routes:

  • Successful route - these are the steps the user takes to get to the goal.
  • Unsuccessful route - these are the steps the user can take that is not the successful route.

Successful Route

Here is an example of a successful route for an e-commerce website or mobile app:

  1. Open the web page or install and start the mobile app.
  2. Search for an item.
  3. Add an item from the search results to a wish list.
  4. Move an item from a wish list to a shopping cart.
  5. Start the checkout process.
  6. Complete the registration.
  7. Purchase the item.
  8. Review shipping information when the item has shipped.

Unsuccessful Route

The unsuccessful route is where the user does not go to the next step. You can use Facebook Analytics to determine the last step the user completed and what step was completed. Any uncompleted step before Purchase the item is considered an unsuccessful step.

Route Details

As you design the route, think about what details you want to capture about the route that your users take. Consider additional data that you want to learn about the behavior of your users. This exercise leads to the way you categorize and manage your data.

For example, you can determine how a user gets to an item from the search feature. You can capture the search terms entered, the results of the search term, the item selected, and then the items added to the cart.

Think about how you would capture the journey of the user through your website or mobile app. How would you capture each step in the journey?

Define the Data to Measure the Route to Success

In this step, you will create the data that you will send to Facebook Analytics that describes each step of a successful route. You can send two types of data:

  • Events and Parameters
  • User Properties

Events and Parameters

Events and parameters describe the action a user completes along with the data in the action. An event is the action that the user completes and the parameters for the event contain the data associated with that event.

Events are broken down into three categories:

  • Standard events - events and parameters that are defined in the Facebook SDK and are generated by your app.
  • Custom events - events and parameters that you define and are generated by your app.
  • System-generated events - events and parameters that are inferred by Facebook based on user interactions with your app and automatically logged. Currently, this list includes:
    • App Install - This event is logged when the user installs your app.
    • App Launch - This event is logged when the user starts your app.
    • Journey - This event is logged when a user of your app accesses it from a different platform. The app administrator must enable journeys in the Facebook Analytics dashboard to generate these events.

When planning out your events and parameters, see if a standard event will work for your application. The following are the standard events

Event NameDescription

Achieve Level

Log this event when a person achieves specific levels you define within your application, business, or organization.


Add Payment Info

Log this event during the addition of customer payment information during a checkout process.


Recommended Parameters

  • content_category
  • content_ids
  • contents
  • currency
  • value

Add to Cart

Log this event during the addition of an item to a shopping cart or basket (example: clicking an Add to Cart button on a website).


Recommended Parameters

  • content_ids*
  • content_name
  • content_type*
  • contents*
  • currency
  • value

*Required parameters for Dynamic Ads.

Add to Wishlist

Log this event during the addition of items to a wishlist (example: clicking an Add to Wishlist button on a website).


Recommended Parameters

  • contentData
  • contentId
  • contentType
  • currency

Complete Registration

Log this event during the submission of information in exchange for a service provided by your business (example: sign up for email subscription).


Recommended Parameters

  • content_name
  • currency
  • status
  • value

Complete Tutorial

Log this event during the completion of a tutorial on your app.


Contact

Log this event during a telephone/SMS, email, chat, or other type of contact between a customer and your business.

Customize Product

Log this event during the customization of products through a configuration tool or other application your business owns.

Donate

Log this event during the donation of funds to your organization.

Find Location

Log this event when a web or app search for one of your business locations suggest that someone might intend to visit (example: searching for a product and finding it at one of your local stores.

In-App Ad Click

Log this event when an ad from a third-party platform is clicked within your app.

In-App Ad Impression

Log this event when an ad from a third-party platform appears on-screen within your app.

Initiate Checkout

Log this event at the start of a checkout process.


Recommended Parameters

  • content_category
  • content_ids
  • contents
  • currency
  • num_items
  • value

Purchase

Log this event during the completion of a purchase, usually signified by receiving order/purchase confirmation or a transaction receipt

If you use Facebook to manage your in-app purchases, the purchase events are automatically logged.


Required Parameters

  • currency
  • value

Recommended Parameters

  • content_ids*
  • content_name
  • content_type*
  • contents*
  • num_items

*Required for Dynamic Ads

Rate

Log this event during a rating of something within your app, business, or organization (example: rates a restaurant within a restaurant review app).

Schedule

Log this event during the booking of an appointment to visit one of your locations.

Search

Log this event during a search performed on your website, app or other property (example: product searches, travel searches).


Recommended Parameters

  • content_category
  • content_ids
  • contents
  • currency
  • search_string
  • value

Spend Credits

Log this event during the completion of a transaction where people spend credits (example: in-app currency) specific to your business or application.


Start Trial

Log this event at the start of a free trial of a product or service you offer (example: trial subscription).


Recommended Parameters

  • currency
  • predicted_ltv
  • value

Submit Application

Log this event during the submission of an application for a product, service, program you offer example: credit card, educational program, or job).

Subscribe

Log this event at the start of a paid subscription for a product or service you offer.


Recommended Parameters

  • currency
  • predicted_ltv
  • value

Unlocked Achievement

Log this event during the completion of specific activities or actions you want to reward within your application, business or organization (refer a friend, complete your profile, etc.).

View Content

Log this event during a visit to a content page you care about, such as a product page, landing page or article.


Recommended Parameters

  • content_ids*
  • content_name
  • content_type*
  • contents*
  • currency
  • value

*Required for Dynamic Ads

If none of the standard events will work for you, then you can use a custom event. Each custom event you create can have up to 25 parameters that you can also define. You can create up to 1,000 custom events.

Although you can create up to 1,000 custom events, you should create the minimum number of custom events to make data management easier. One way to create the minimum number of custom events is differentiate events by using parameters instead of create an event for each action.

For example, if your website or mobile app has several menu items, use a single event to log the action of choosing a menu item and then use a parameter to describe the menu item.

The parameter is the data that quantifies the event. The parameter is a collection of key value pairs. Each key in the parameter must have a unique name. You can use the parameter names in the SDK or create a unique name. The value of the key value pair must be a string or a number. Whenever possible, define the appropriate value for each key value pair and ensure that the value that you will assign in the key value pair is the appropriate value. For example, assign strings to a key value pair expecting a string and assign a number to a key value pair that is expecting a number. Checking the data before assignment is especially critical if your app is written in a weakly typed language, such as JavaScript.

The example e-commerce website and mobile app has several steps to a successful route. The following is an example of how to use events to describe each step.

StepEvent NameEvent Type

Open the web page or install and start the mobile app.

App Install

Automatically logged

Search for an item.

Search

Custom

Add an item from the search results to a wish list.

Add to wish list

Standard

Move an item from a wish list to a shopping cart.

Add to cart

Standard

Start the checkout process.

Initiate Checkout

Standard

Complete the registration.

Complete registration

Standard

Purchase the item.

Purchase

Standard

Review shipping information when the item has shipped.

Review shipping

Custom

Do not send personal identifiable information (PII) or any data that has a 1:1 relationship with a user in a parameter.

User Properties

You can create segments based on what you know about your users by using user properties. A user property is a value that you assign to a user who meets a specific criteria. For example, you can create a user property to track a user to a loyalty program. The values in the property can be Gold, Silver, or Bronze, depending on how much the user has bought using your app.

You can have up to 100 user properties.

Do not store personal identifiable information (PII) in a user property.

Managing Your Data

After you create your events and parameters and user properties, create a data dictionary that documents this data. The data dictionary can help you and your organize keep track of your data so that your organization sends the right data to Facebook Analytics.

For example, the Purchased standard event has the following parameters: * purchasedAmount * currency * parameters

You use this standard event to log each item in the shopping cart that was purchased.

The data dictionary would have the following entry:

ParameterDescriptionData typeSource

purchasedAmount

Price of the item

Double

The price of the item when added to the shopping cart.

currency

The currency of the price of the item.

String

Database table

parameters

The item name, description, color, and size.

Key-value pair as strings

Shopping cart

Implement the Data

In this step, you will implement the events and parameters and the user properties you defined in the previous step in your website or mobile app.

To implement an event and the parameters, use the code configurator to generate the code to add to the appropriate section of your code.

To Generate Code for a Standard Event

  1. Choose the Standard Event tab.
  2. In Event Name, choose a standard event.
  3. Choose Get Code.
  4. In the window, select a language to see the code to copy and paste into your app.

To Generate Code for a Custom Event

  1. Choose the Custom Event tab.
  2. In Event Name, enter the name of you custom event.
  3. In Use Value to Sum?, choose On if you will have this value.
  4. For each parameter in your custom event, choose Add Event Parameter, enter the name of the parameter, and then choose a data type.
  5. Choose Get Code.
  6. In the window, select a language to see the code to copy and paste into your app.

To implement a user property, see User Properties