Codeless App Events

Codeless App Events, introduced in v4.34, enable you to use the Events Manager to add or remove app events without implementing code or releasing a new version of your app.

Android

Requirements

You must have one of the following:

Please see the Getting Started with App Events for Android Guide to install the latest version of the Facebook SDK for Android, the Upgrade Guide to upgrade to the latest version of the SDK, or, if you installed v4.34-4.37, add the Marketing Kit by opening your <your_app> | Gradle Scripts | build.gradle (Module: app) and adding the following to the dependencies{} section.

implementation 'com.facebook.android:facebook-marketing:[4,5)' 

Don't forget to rebuild your project.

Implement the Codeless App Event Feature

To turn on Codeless debug event, add the following lines in AndroidManifest.xml:

<meta-data
    android:name="com.facebook.sdk.CodelessDebugLogEnabled"
    android:value="true" />

Add Your App Events

Go to the Events Manager to codelessly add app events you want to track.

  1. In the Events Manager click Add New Data Source and select App Events in the dropdown menu.
  2. Click Use our codeless event setup tool then select the app you want to add events to.
  3. Choose the platform by clicking on Start Setup.
  4. If this is your first time visiting the codeless flow you'll see a small tutorial. After the tutorial, open a new session of your app on your mobile device.
  5. Shake your phone until a version of your app appears.
  6. Click on any element to add an app event. Navigate to different pages of your app to select elements throughout your app.
  7. Click Save in the popup menu or Cancel to not add the event.
  8. When you have added all your events click Review and Finish.
  9. Click Test Events or Save and Exit.

Note: It may take up to 30 minutes for events to appear in your Events Manager.

Verify Your Integration

Go to App Ads Helper.

  • Select an App and click Submit.
  • Scroll down to the Developer Tools section and click Test App Events.
  • If your app is sending fb_codeless_debug events, the test events you selected will be listed in the table.

Note: Only works for Facebook SDK v4.35 and above.

iOS

Requirements

  • Facebook iOS Full SDK v4.34 to v7.1.1
  • Facebook iOS Core SDK v4.38 to v7.1.1
  • Facebook iOS Core SDK v4.34-4.37 to v7.1.1 and the Marketing Kit

Limitations

  • This feature is not available for v8.0.0 or later. Learn more.

Please visit the Getting Started with App Events for iOS Guide to install the latest version of the iOS SDK, the Upgrade Guide to upgrade to the latest version of the SDK, or, if you have installed v4.34-4.37 of the Core SDK only, add the Marketing Kit by adding the following to your Podfile.

pod 'FBSDKMarketingKit' 

Don't forget to run pod update then pod install --repo-update.

Implement Codeless App Event Feature

Turn on Codeless debug event logging by opening the application's .plist as code in Xcode and add the following XML to the property dictionary:

<key>FacebookCodelessDebugLogEnabled</key>
<true/>

Add Your App Events

App Store Connect for iOS 14

Events that your app collects and sends to Facebook may require you to disclose these data types in the App Store Connect questionnaire. It is your responsibility to ensure this is reflected in your application’s privacy policy. Visit the Apple App Store Privacy Details article to learn more about the data types you will need to disclose.

Go to the Events Manager to codelessly add app events you want to track.

  1. In the Events Manager click Add Data Source and select App Events in the dropdown menu.
  2. Click User our codeless event setup tool then select the app you want to add events to.
  3. Choose the platform by clicking on Start Setup.
  4. If this is your first time visiting the codeless flow you'll see a small tutorial. After the tutorial, open a new session of your app on your mobile device.
  5. Shake your phone until a version of your app appears.
  6. Click on any element to add an app event. Navigate to different pages of your app to select elements throughout your app.
  7. Click Save in the popup menu or Cancel to not add the event.
  8. When you have added all your events click Review and Finish.
  9. Click Test Events or Save and Exit.

Note: It may take up to 30 minutes for events to appear in your Events Manager.

Verify Your Integration

Go to App Ads Helper.

  • Select an App and click Submit.
  • Go to the bottom and choose App Events Tester.
  • If your app is sending fb_codeless_debug events, they will be listed in the table.

Unity

We require Facebook Unity SDK v4.34 or higher.

See Getting Started with Facebook Unity SDK to install the latest version of Facebook Unity SDK, and follow platform-specific settings for Unity iOS or Unity Android.

Enable Codeless App Events

To turn on this option, in Unity Editor select Facebook | Edit Settings, then select Auto Logging App Events:

Add App Events

At this point you can add App Events with Events Manager:

  1. Under Add Data Source, select App Events.

  2. Click User our codeless event setup tool

  3. Select the app you want to add events to.

  4. Click Start Setup to select your platform. If this is your first time visiting the codeless flow you'll see a small tutorial.

  5. After the tutorial, open a new session of your app on your mobile device.

  6. Shake your mobile device until a version of your app appears.

  7. Click on any element in your app to add an app event. Navigate to different pages of your app to select elements throughout your app.

  8. In Unity Editor, click Save to add the event.

  9. After you have add all your events click Review and Finish.

  10. Click Test Events or Save and Exit.

It may take up to 30 minutes for events to appear in your Events Manager. Repeat these steps for each platforms, such as iOS or Android that your game support.

Verify Your Integration

Go to App Ads Helper.

  • Under Select an App, Click Submit.

  • Choose App Events Tester.

  • If your app sends fb_codeless_debug events, they appear in the table.

FAQ

GENERAL

1. How can I check whether the Codeless feature is integrated correctly?

A few minutes after you have launched your app on your test device, you will see events with the name fb_codeless_debug in the Events Manager.

2. How do I turn off the Codeless feature?

To turn off Codeless app event logging, use the codeless event setup tool and remove all events.


Android

1. What do I do if I see the following build error:
Android SDK build Error:Execution failed for task ':app:processDebugManifest'.> Manifest merger failed : 
Attribute activity#com.facebook.FacebookActivity@theme value=(@android:style/Theme.Translucent.NoTitleBar) 
from AndroidManifest.xml:69:13-72is also present at [com.facebook.android:facebook-android-sdk:4.16.0] 
AndroidManifest.xml:32:13-63 value=(@style/com_facebook_activity_theme).Suggestion: add
'tools:replace="android:theme"' to <activity> element at AndroidManifest.xml:66:9-70:47 to override.
Add the following to the manifest element in your AndroidManifest.xml file:
<manifest>
  ...
  xmlns:tools="http://schemas.android.com/tools"
  ...
</manifest>
And the following to the activity element:
<activity>
  ...
  tools:replace="android:theme"
  ...
</activity>

iOS

1. What do I do if I see the following warning:
[!] Unable to find a specification for FBSDKMarketingKit
Run pod update then pod install --repo-update.