In this section · 4 articles

Show content to an audience

Create an audience, such as iOS users or people on app version 2.0 and newer, from rules on the platform, version, country, role and more. Then use it to choose who sees an onboarding flow, a menu item or a dashboard.

Applies to
Core Mobile 2.0 and later
Who can do this
Platform owner
Permission
feature.cm.audience.create
Where
Core Mobile › Audiences (Platform Administration)
On this page

An audience is a reusable group of app users, defined by rules. You pick it in the Audience field of an onboarding flow, a menu item or an app dashboard, and only apps that match see that item.

For a simple case, you may not need one: those items also have their own Platform, Minimum version and Maximum version fields.

Before you start

  • You need Create Audience (feature.cm.audience.create), and Edit Audience (feature.cm.audience.edit) to change one.
  • Know what the app sends. Rules can only use what the app tells your Laramin, or what your Laramin knows about a signed-in person. See the table of attributes below.

What a rule can check

AttributeWhere the value comes from
platformThe app: ios, android or web.
app_versionThe app's version, such as 2.1.0. Compared as a version number.
countryThe app, if it sends a country.
device_classThe app, if it sends a kind of device, such as tablet.
localeThe language your Laramin answers in.
roleThe signed-in person's roles, by name. Empty when nobody is signed in.
permissionThe signed-in person's permissions, by key.
tenantThe signed-in person's business, where your Laramin uses one.
date_windowThe current date and time.
subscription, feature_flag, cohortCore Mobile 2.1.0 offers these, but never gives them a value, so a rule on them never matches.

Roles and permissions are the ones a person holds everywhere, not ones held only inside one team.

OperatorMatches when the value…
eq, neqequals, or doesn't equal, the rule's value.
in, ninis, or isn't, in a list such as ["ios","android"]. For roles and permissions, when the person holds any of them.
gte, lteis at least, or at most, the rule's value.
betweenis between two values, given as a list: ["2.0.0","2.9.9"].
existshas any value at all.

Create an audience

  1. In the Platform Administration sidebar, select Core Mobile › Audiences.

  2. Select Create.

  3. Enter a Name, such as Android, version 2 and newer, and optionally a Description. A key is made from the name when you save.

  4. Under Rules, add one row for how the rules combine, then three rows for each rule. Select Add row for each:

    Key pathTypeValue
    opStringall (every rule must match), any (one is enough) or none (no rule may match)
    rules.0.attrStringplatform
    rules.0.opStringeq
    rules.0.valueStringandroid
    rules.1.attrStringapp_version
    rules.1.opStringgte
    rules.1.valueString2.0.0

    Number the rules from 0. For a list, choose JSON as the type and enter it in square brackets, such as ["ios","android"]. An audience can have up to 50 rules.

  5. Turn Status on.

  6. Select Save.

You see, for example, 'Audience "Android, version 2 and newer" saved.' An audience with no rules matches everyone.

If a rule names an attribute or operator that doesn't exist, you see, for example, "Rule row 1 references an unknown attribute." Row 1 is rules.0, row 2 is rules.1, and so on.

Use the audience

On an onboarding flow, a menu item or an app dashboard, choose the audience in Audience and save. See Build an onboarding flow and Set up the app's menus and home dashboard.

Careful: An item whose audience is switched off or deleted is shown to nobody, not to everyone. The example audiences Core Mobile comes with, iOS Users and Modern App Versions, start switched off: turn one on before you use it.

Rules that need a value the app doesn't send fail: for example, a country rule never matches an app that doesn't send a country, and a role rule never matches before sign-in.

Mobile Experience Rules

Core Mobile › Mobile Experience Rules stores rules with a Name, Priority, Target and Action, for a future rules engine. Core Mobile 2.1.0 doesn't act on them, although the screen doesn't say so. Use audiences instead.

The Create Mobile Experience Rules drawer open over the empty Mobile Experience Rules list, with Name, Description, Priority, Status and the Target and Action rows.