This Quickstart shows how to integrate Facebook Analytics into a new or existing Swift or Objective-C app.
Please log in to Facebook to create apps or register as a developer.
sudo gem install cocoapods
info.plistand choose Open As Source Code.
Use the App Event Builder to generate the code in your language to implement either a custom or pre-defined app event that you can then add to your app.
After you integrate the Facebook SDK into your app, the following events are automatically logged:
The first time a new user activates an app or the first time an app starts on a particular device.
When the Facebook SDK is initialized in your app for each session.
When a purchase processed by the Apple App Store or Google Play has been completed. If you use other payments platforms, you will need to add purchase event code manually.
The following table contains the pre-defined events. Use the App Event Builder to get the code for these events.
Log this event when the user has achieved the level in the app. The level is specified in a parameter.
Add Payment Info
Log this event when the user has entered their payment info.
Add To Cart
Log this event when the user has added an item to their cart. The
Add To Wishlist
Log this event when the user add an item to their wish list. The
Log this event when a user has completed registration with the app.
Log this event when the user has completed a tutorial in the app.
Log this event after the user completes a purchase using your own purchase method. If you use Facebook to manage your in-app purchases, the purchase events are automatically logged.
Log this event when the user gives a rating. The
Log this event when a user performs a search within the app.
Log this event when the user has spent their app credits. The
Log this event when the user unlocks an achievement in the app.
Log this event when a user has viewed a form of content in the app.
The App Ads Helper allows you to test your app events to ensure that your app is sending events to Facebook.
a. Open the App Ads Helper.
b. In Select an App, choose your app and choose Submit.
c. Go to the bottom and choose Test App Events.
d. Start your app and send an event. The event appears on the web page.
The demo app does not have an Event Debugging link. This link is only available in apps that you create.