# Facebook App Events

Use Facebook App Events to track events your users triggered in an app. Some examples could be an app installation, or completing a purchase.

You'll need to have a Facebook Developer account, and one app created there.&#x20;

{% hint style="info" %}
This feature is available as part of the [Advanced and ](https://projects.bravostudio.app/pricing)[Business App](https://projects.bravostudio.app/pricing) plans.
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=QFPCEVrB0f0>" %}

##

## 1. Facebook Meta developer portal app

1. Go to <https://developers.facebook.com/apps/?show_reminder=true>
2. Create an app

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FP6SmYoIYR66m30XT6hyq%2Fimage.png?alt=media&#x26;token=834f36c6-7db7-4e7b-92a8-cb3a0bc09d23" alt=""><figcaption></figcaption></figure>

3\. Follow all the steps to create the app

4\. Add **App Events** to the app created.

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FV0rRCfHkSUc1igXzKroH%2Fimage.png?alt=media&#x26;token=25afe509-aaef-475e-a395-c724c9c0ef33" alt=""><figcaption></figcaption></figure>

## 2. Bravo configuration

1. Upgrade your app to **Business**.
2. Go to the Integration section > Analytics.
3. Enable the **Facebook App Events SDK** feature.
4. In the Facebook Portal, copy the Facebook App ID and the Client Token then paste them into Bravo Studio

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FEENXrq4HOzc2cRJrbSub%2Fimage.png?alt=media&#x26;token=64ef5bc5-4694-46fb-9701-3b75bb754d95" alt=""><figcaption></figcaption></figure>

5\. For Android, you need to request a build since an **SHA** will be needed.&#x20;

## 3- Facebook Meta developer portal app

In My apps, open the app dashboard, select Settings → Basic

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2Fps92onQOityM5S1CE95z%2Fimage.png?alt=media\&token=942eb041-11ba-45cd-8b4f-5b777e2d7972)

Go to the bottom and choose Add Platform, choose the platforms your app will use.

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FsZg9WkTBFNGtcKuC2ptw%2Fimage.png?alt=media\&token=8f5a1259-d6d3-447e-9b22-b82b4127f062)

Next, you will need to fill in some information.

### For iOS

You need to fill at least: the Bundle ID, iPhone Store ID and iPad Store ID. Bundle ID needs to be the same one you use for the app publication form in Bravo.

Regarding the iPhone Store ID and iPad Store ID, this can be obtained in the Appstore Connect.

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FUpxL0YhhCJN2eN5l99ZF%2Fimage.png?alt=media&#x26;token=55786a3a-c51d-481c-85e0-1d1b42f36c5e" alt=""><figcaption></figcaption></figure>

### For Android

You’ll need to request builds to get the needed key hashes. Debug APK and Publishable AAB have different key hashes, so be sure you add both.

There's a column in the **Build Request History** table to get this keys.

Add your package name, and in Class Name enter <mark style="color:red;">`BravoActivity`</mark>

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2F4wnJKdIwV8fzXtoJXUeg%2Fimage.png?alt=media&#x26;token=e4ddc97a-bf31-424d-b727-80befd30e97c" alt=""><figcaption></figcaption></figure>

Now fill the required facebook settings in the Bravo page. You need the Facebook APP ID and the Facebook Client Token.

Facebook App ID you can find it here:

![](https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FyuFMVyt0yFypXryoeptS%2Fimage.png?alt=media\&token=951413d3-d3c1-474b-acc3-ad8930d328f8)

Regarding Facebook Client Token, you need to go to Settings > Advanced, you will find it there.

<figure><img src="https://1444025092-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MXpqEanvOhm8vMtIH8i%2Fuploads%2FdGg2UAIWD1EtYfPLqkn1%2Fimage.png?alt=media&#x26;token=8b22f33a-1c6c-426a-809c-a234ad9e1add" alt=""><figcaption></figcaption></figure>

Once Bravo settings are saved, Facebook Events should be ready to test, Facebook events will only work on the final app, so create a new app package.

Once the package is installed it should ask the users if they accept to be tracked, if they click Yes, Facebook will start tracking the users and the events should start to be received by Facebook (Could take some minutes for the events to be logged).

They should appear in the [Facebook Events Manager](https://www.facebook.com/events_manager2/?act=26061943)

Choose Data Sources and the app you created, you should see the events there.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bravostudio.app/integrations/facebook-app-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
