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 visit the Getting Started with App Events for Android Guide to install the latest version of the Android SDK, 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 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.
  • 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

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

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.

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 or Facebook Analytics.


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.