Docs
/
/
Platform
Concepts
Audiences

Audiences

Learn how to use Audiences to power your lifecycle and transactional messaging.

An Audience is a user segment that you can use to target users for workflows, guides, and broadcasts. Knock supports two types of audiences: static and dynamic. Dynamic audiences are maintained in real-time based on a set of defined conditions. Static audiences are mained via direct updates, either via a reverse ETL source such as Hightouch or Census, a CSV upload, the API, or manually in the Knock dashboard.

Use audiences to:

  • Trigger workflows for lifecycle messaging (such as new user signups) and transactional messaging (such as payment method updates).
  • Orchestrate branch and conditional logic within your workflows using audience membership (e.g. if a user is in a paid users audience, opt them out of the workflow).
  • Target users for an in-app guide.
  • Send a one-time message to a specific audience with a broadcast.

Creating an audience

#

To create an audience, navigate to the Audiences page under the Recipients section on the Knock dashboard’s sidebar, then click “Create audience” in the top right corner. Determine whether the audience will be dynamic or static. Audience types cannot be changed after creation.

Dynamic audiences

#

Dynamic audiences are built by creating a set of query rules on top of the user data in Knock, expressed as conditions. You can build dynamic audiences using the properties available on your user objects. For a full reference of supported condition types and operators, see the conditions docs.

Knock will automatically update the dynamic audience in real-time as the user data in Knock changes, moving users in and out of the audience as their properties change. These changes are known as "membership events" and are used to trigger workflows.

When building a dynamic audience, you will see a real-time preview of the audience members that match the query rules you’ve created on the right side of the screen. Remember, these are users in the current environment that match the query rules you’ve created.

Changes to dynamic audience are versioned and promoted to environments. These changes must be made in your environment's main branch.

Static audiences

#

Static audiences are populated by adding users directly. You can populate a static audience in four ways:

  • Reverse ETL support. Audiences can easily be synced from Hightouch Models and Census Segments by configuring Knock as a sync destination. Click through to the integration-specific documentation for more information.
  • Audiences API. The Knock API can be used to sync audiences from any data warehouse or reverse ETL system. Create the audience in the Knock dashboard, then use the add and remove API operations to power your sync. The API is designed for batch processing and accepts payloads of up to 1,000 members at a time. For more information see the audiences API docs.
  • CSV upload. You can upload a CSV of users to an audience. After uploading your CSV, you can map the CSV fields to the corresponding user fields in Knock. Knock will upsert the users as they are added to the audience and skip any users with malformed or missing IDs. The maximum size of a CSV upload is capped at 10MB.
  • Manually. You can manually add existing users to an audience in the dashboard.

Audiences and workflows

#

Audiences integrate with workflows in two key ways. You can configure a workflow to trigger automatically whenever a user enters an audience, enabling event-driven lifecycle messaging without additional API calls. You can also use audience membership as a condition in branch and step conditions to gate logic based on which audiences a user belongs to at the time of execution.

Audiences and tenants

#

When adding users to static audience you can optionally include a tenant ID to power per-user, per-tenant workflows. A user can exist in an audience with multiple distinct tenants. Currently, tenant targeting is only supported for static audiences, but support for dynamic audiences is coming soon.

An audience member with multiple distinct tenant ids

When a workflow triggers from an audience entry event, the tenant ID provided for the member will be passed along to the workflow trigger. If no tenant ID is provided in the API request, the workflow will run with no tenant data. If the same user is added with multiple distinct tenants, the workflow will trigger each time by default. To configure this behavior use trigger frequency controls.

Tenancy is also taken into account when checking audience membership. For a recipient to be considered a member of an audience during workflow execution, the tenant ID provided with the trigger data must match the user’s audience membership record. If no tenant ID was provided with the trigger, the user must have been added to the audience with no tenant ID.

For more information about how audience membership is evaluated for guides eligibility, see the guides documentation.

Frequently asked questions

#

If you add a user to an Audience who has not yet been identified to Knock, they will be indicated as a "missing user" in the audience. If you subsequently identify a user with the missing user_id, they will be a member of the audience and no longer "missing."

However, Knock will not retroactively trigger any audience-entry triggered workflows for users that are identified after being added to the audience.

Yes, you can create a dynamic audience by querying the user data in Knock. Learn more about building a dynamic audience.

No, currently you cannot use source event data to build a dynamic audience. We will be adding this capability in the future. Please get in touch if you have a specific use case for this functionality.

No, you can currently only build dynamic audiences using user data in Knock. We will be adding support for other object data in the future, including the ability to build a list of users based on their relationship to other objects in your system (like tenants). Please get in touch if you have a specific use case for this functionality.

Dynamic audiences are updated in real-time. Any changes to the user data in Knock will be reflected in the dynamic audience immediately. That means if you have a property plan_type on the user object, and you build a dynamic audience for users on the pro plan, setting the plan_type to pro will immediately add the user to the dynamic audience.

While you can use an audience on a development branch to power workflows, broadcasts, and guides, you cannot make changes to an audience on a branch. You can only make changes to an audience on the main branch.

The reserved created_at and updated_at properties on user objects cannot be used in dynamic audience conditions. If you need to filter users by these values, store them as custom properties on your user objects in Knock.

Users can be removed from a static audience in one of three ways:

New chat