Targeting by App Activity

You can create ads targeting people based on the actions they are taking within your app. For example, you can target people who previously used your app, but have not come back to your app within the last 90 days. Or you can target people who have added an item to their cart but didn't make a purchase. See Scenarios below for links to examples.

To target people by app activity, create a Custom Audience based on App Events. This page tells you how.

Why is this Important?

You can reach the relevant audience for your needs. You can also provide a more positive experience by showing ads only to people who are likely to be interested in them.

Requirements

You need to add App Events to your app to track actions people are taking within your app.

Related

Custom audiences can also be based on customer lists. See Targeting by Customer Lists.

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.

Before You Start: Read our Essential Guides

1. App Ads

Learn how ads for apps work.

2. SDK Setup and Adding App Events

In most cases, you need to add the Facebook SDK before creating your custom audiences.

3. Example Case: Bring People Back to Your App

This guide walks you through an example so you can learn how to create a custom audience.

4. App Events

Learn how app events work.

Recently Opened Your App

1. Add App Launch Tracking to Your App

To create a custom audience based on recent activity, you need to track app launches using App Events. Track app launches by calling the activateApp method:

- (void)applicationDidBecomeActive:(UIApplication *)application {
   [FBSDKAppEvents activateApp];
}
@Override
protected void onResume() { 
  super.onResume(); 
  AppEventsLogger.activateApp(this); 
}
FB.AppEvents.activateApp();

2. Create Custom Audience by Recent Activity

Start creating a new ad. In Audience, choose Create New > Custom Audience and pick the following options:

Option Your Value

Type of audience

App Activity

Action taken

Opened the app

In the past

30 days

Recently Completed a Purchase

1. Add Purchase Logging to your App

To create a custom audience based on purchase behavior, you need to log purchases using App Events. Track purchases using the logPurchase method:

[FBSDKAppEvents logPurchase:4.32 currency:@"USD"];
logger.logPurchase(BigDecimal.valueOf(4.32), Currency.getInstance("USD"));
var parameters = {};
parameters[FB.AppEvents.ParameterNames.CONTENT_ID] = "QW-12345";
FB.AppEvents.logPurchase(4.32, "USD", parameters);

2. Create Custom Audience by Purchases

Start creating a new ad. In Audience, choose Create New > Custom Audience and pick the following options:

Option Your Value

Type of audience

App Activity

Action taken

Purchase amount: Top 25%

In the past

30 days

Advanced 1: Narrow your Audience by Including More Criteria

You may also want to target your ads to a more specific audience. For example, you may want to reach users who have made a purchase within your app in the past 30 days, but not the past 7.

Choose Exclude, and choose the following options:

Option Your Value

Action taken

Purchase amount: Top 25%

In the past

7 days

Advanced 2: Create Custom Audience by Abandoned Carts

Target people who expressed interest in completing a purchase but haven't done so by using the following options:

"Create Custom Audience" From Option Your Value

Type of Audience

App Activity

List of people based on ...

Combined Action

Action Taken

Add to Cart

In The Last

30 days

Action Not Taken

Purchases

In The Last

30 days


Completed Large Purchases

1. Add Purchase Logging to your App

Take same steps as in Recently Completed a Purchase: 1. Add Purchase Logging to your App.

2. Create Custom Audience by Large Purchases

Start creating a new ad. At the point of defining your ad audience create new custom audience and pick the following options when filling out the custom audience form:

"Create Custom Audience" From Option Your Value

Type of Audience

App Activity

Action Taken

Purchases

Event's USD Value

is geater than 100

In The Last

90 days

Achieved a level

1. Add Event Tracking to your App

To create a custom audience based on level achievements you need to track such events using App Events. Track level achievements - or other events - by calling the logEvent method and providing a level parameter:

[FBSDKAppEvents logEvent:FBSDKAppEventNameAchievedLevel
  valueToSum:nil
  parameters:@{ 
    FBSDKAppEventParameterNameLevel: 123
  }
];
AppEventsLogger logger = AppEventsLogger.newLogger(this);
Bundle parameters = new Bundle();
parameters.putString(AppEventsConstants.EVENT_NAME_ACHIEVED_LEVEL, 123);
logger.logEvent(
  AppEventsConstants.EVENT_NAME_ACHIEVED_LEVEL,
  null,
  parameters
);
var parameters = {};
parameters[FB.AppEvents.ParameterNames.LEVEL] = 123;
FB.AppEvents.logEvent(
  FB.AppEvents.EventNames.ACHIEVED_LEVEL,
  null,
  parameters
);

2. Create Custom Audience by Level Achievement

Start creating a new ad, choose App Engagement as your objective. At the point of defining your ad audience create new custom audience and pick the following options when filling out the custom audience form:

"Create Custom Audience" From Option Your Value

Type of Audience

App Activity

Action Taken

Levels Achieved

Level

is any of 123

In The Last

28 days