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.
Log this event when the user clicks on an advertisement.
Log this event when an advertisement appears to the user.
Add Payment Info
Log this event when the user has enters payment information as part of the checkout process.
Add To Cart
Log this event after the user adds an item to their cart.
Add To Wishlist
Log this event after the user add an item to their wish list.
Log this event after the user completes registration in the app or website.
Log this event after the user completes a tutorial in the app or website.
Log this event after the user submits their contact information.
Log this event after the user modifies a product selection using your tool to modify a product.
Log this event after the user donates funds to your organization or cause.
Log this event after the user finds one of your locations with an intention to visit. For example, when the user selects a button that displays the closest store with the product in stock.
Log this event after the user starts the checkout process.
Log this event after the user uses your own purchase method to complete a purchase. If you use Facebook to manage your in-app purchases, the purchase events are automatically logged.
Log this event after the user gives a rating.
Log this event after the user makes an appointment to visit your location.
Log this event after the user performs a search within the app.
Log this event after the user has spends their app credits.
Log this event after the user chooses to start a free trial of your product or service.
Log this event after the user submits an application for a product, service, or program.
Log this event after the user subscribes to a product or service.
Log this event after the user unlocks an achievement in the app.
Log this event after the user views 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.