AppFig Start free
  1. Home
  2. Glossary
  3. What is behavioral targeting in a mobile app?

What is behavioral targeting in a mobile app?

Behavioral targeting chooses what a user sees from what they have done in the app, such as events, counts and recency, not from who they are.

Behavioral targeting means deciding what a user gets from what they have done in the app, not from who they are. A rule such as "completed five levels this week and has never bought anything" is behavioral; a rule such as "lives in Germany and is on the premium plan" is not.

Both kinds of rule choose a remote config value or switch a feature flag. They differ in the data they read.

Who the user is and what the user did

Who they are is described by properties: country, language, platform, app version, subscription tier. Properties change rarely and are often grouped into saved audiences.

What they did is described by events the app logs as the user goes along. A behavioral rule can ask four kinds of question about them:

Event parameters narrow these further: a purchase above a certain amount.

What it is used for

The same person gets a different answer at different moments, which properties cannot express.

Why timing matters

The player who has just failed level 8 for the second time needs the hint now, on the retry screen, not in tomorrow's session.

When targeting is decided on a server, the event has to be sent, processed and matched to an audience before the user's values change. When it is decided on the device, the event is already there the moment the app logs it. See client-side evaluation.

How AppFig does it

The app logs events to the SDK, for example AppFig.LogEvent("level_complete") in Unity, and the SDK keeps them in its event history. When the code asks for a value, the SDK checks the downloaded rules against that history on the device, with no network call, so an event logged a moment ago already counts.

This rule, built from the examples in the rule schema, returns "on" for users who completed at least five levels in the last seven days and have not made a purchase:

{
  "conditions": {
    "events": {
      "mode": "simple",
      "operator": "AND",
      "items": [
        {
          "key": "level_complete",
          "count": { "operator": ">=", "value": 5 },
          "within_last_days": 7
        },
        {
          "key": "purchase_made",
          "count": { "operator": ">=", "value": 1 },
          "not": true
        }
      ]
    },
    "user_properties": [],
    "user_properties_operator": "AND",
    "device": [],
    "device_operator": "AND"
  },
  "value": "on"
}

Sequence mode checks order: "direct" means the events came one straight after another, "indirect" allows other events in between. Event, user property and device conditions can share a rule, and all three must pass. The first matching rule wins; if none matches, the lookup returns null and your code uses its fallback. See Core concepts.

FAQ

How is behavioral targeting different from audience targeting?

An audience is a saved group of users, usually worked out on a server. Behavioral targeting reads the user's events directly, so the answer can change from one moment to the next.

Does behavioral targeting need a network connection?

It depends on where the rules are checked. In AppFig they are checked on the device against events the app has logged, so they keep working offline.

Can I A/B test a behavioral rule?

Yes. In AppFig an experiment's audience uses the same conditions as any rule, so a test can be limited to users who did a particular thing. See What is A/B testing?.

Keep reading