Facebook

New in version 2.1.0.

Changed in version 3.5.0: Added support for action templates and parameters

Facebook is a tracking service which supports tracking events (actions and purchases). It also supports tracking the installation of the app.

General

For setting up the App in Facebook Analytics use the following information:

Android Class Name: com.sprylab.purple.android.app.purple.splash.SplashActivity

Andriod Key Hash (Preview Apps): VnOtQRWs9tYehKQDf9SeALlqsxc=

For Release Apps you need to create a hash from your release keystore. See the official Facebook documentation for more information.

Events

Overview

Key-Name in Config Action Templates View Templates Purchase Templates Attribute Templates
facebook action unsupported unsupported unsupported

Actions

Facebook supports tracking of action events. The actual value sent to Facebook is configured through a template with the key action.

Hint

Event names and parameter names length must be under 40 characters and contain only alphanumeric characters, ‘_’, ‘-‘ or spaces, and cannot start with a space or hyphen.

For more information please see the official Facebook documentation.

Views

Facebook does not support view events.

Purchases

Facebook supports tracking of purchase events. Purchase events only send the price and currency for the purchase. The product id can be sent with custom parameters.

Warning

“Log In-App Purchase Events Automatically on iOS” setting should be disabled otherwise in-app purchases logging will be duplicated.

To disable the setting follow the steps below:

  1. Go to My Apps.
  2. Select your app.
  3. Click on the settings tab on the left nav.
  4. Find the section labeled iOS.
  5. Disable the switch called “Automatically Log In-App Purchase Events on iOS”.

For more information please see the official Facebook documentation.

Attributes

Facebook does not support storing attributes per user.

Event parameters

Facebook supports sending custom parameters for actions and purchases.

Hint

An event can have up to 25 parameters. This doesn’t just mean for each call, but for all invocations that use that event name.

If you need to remove obsolete parameters - you can deactivate parameters by following the instructions in the Facebook help center.

The length of each parameter value can be no more than 100 characters.

For more information please see the official Facebook documentation.

Configuration Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "facebook": {
    "events": {
      "APP_BOOKMARK_ADDED": {
        "templates": {
          "action": "Bookmark added {{CONTENT_NAME}}"
        },
        "parameters": {
          "pageinfo.brand": "purple"
        }
      }
    },
    "purchases": {
      "KIOSK_ISSUE_PURCHASED": {
        "templates": {
          "action": "Issue purchased {{ISSUE_ID}}"
        },
        "parameters": {
          "product": "{{PRODUCT_ID}}",
          "issue.id": "{{ISSUE_ID}}"
        }
      }
    }
  }
}