Audience defines a criteria-based audience for personalization in an Experience Builder site. It combines rules for matching users with target assignments, such as page variations or navigation link sets. The required container identifies the containing site or org, and audienceName names the audience.
Audience targeting controls what users see in the browser. It is not a data-access control: sharing rules, permission sets, and other Salesforce security controls must still protect sensitive data. A permission-based audience checks a user's existing permission state; it does not grant permissions.
Key Elements
Criterion elements belong inside criteria and its criterion entries. Target elements belong inside targets and its target entries.
| Element | What the Element Controls |
|---|---|
audienceName |
Required. The name of the audience. |
container |
Required. The site or org containing the audience. Its populated value matters when identifying site dependencies. |
criteria |
Required wrapper containing criterion entries. An audience cannot be created without criteria and can contain up to 100 criteria. |
criteriaNumber |
The identifier used to refer to a criterion in a custom formula, such as (1 AND 2) OR 3. |
type |
Required for each criterion. Valid values are GeoLocation, Domain, Profile, FieldBased, Permission, Default, and Audience. The value determines which criterion-value fields apply. |
criterionValue |
Contains the values tested by a criterion. Fields for one criterion type are not interchangeable with fields for another. |
operator |
The comparison applied by the criterion. Values are Equal, NotEqual, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, Contains, StartsWith, Includes, and NotIncludes. |
formulaFilterType |
AllCriteriaMatch requires all criteria to match; AnyCriterionMatches requires any criterion to match; CustomLogicMatches combines criteria using formula. |
formula |
The custom matching expression, using the criteria's criteriaNumber identifiers. |
isDefaultAudience |
Optional boolean identifying whether this component is the default audience. It is separate from the criterion type Default. |
targets |
The desired complete target-assignment list when supplied. Omitting this element preserves assignments; supplying an empty element removes all assignments. |
groupName |
Required for each target. Groups related target-and-audience pairs. A group can span assignments in more than one audience. |
priority |
Determines which target is returned within a group when a user matches more than one audience. Interpret priority across the relevant group, not just one Audience file. |
targetType |
Required for each target. Supported values include ExperienceVariation, NavigationLinkSet, Report, and Dashboard. |
targetValue |
Required for each target. For ExperienceVariation, this is the variation's developer name, not its record ID. |
Behavior and Constraints
Access to Audience metadata requires the AudienceMetadata permission. Access to permission criteria additionally requires AudiencePermissionCriteria. Both permissions are on by default in orgs with Networks enabled.
Choose criterion-value fields according to the criterion's type:
-
Audience: UsesaudienceDeveloperNameto reference another audience by developer name. A change to the referenced audience can therefore affect matching through its dependent audiences. -
FieldBased: CombinesentityType,entityField, andfieldValue. The object and field can reference custom metadata definitions. AnentityFieldvalue can also be a relationship path, such asManager.Profile.CreatedBy.Contact.MailingCountry, so understanding the condition can require following several objects and fields. -
Permission: CombinespermissionName,permissionType, andisEnabled. The permission name is the API name of a standard user permission or custom permission. AlthoughpermissionTypeis a string, its allowed values areStandardandCustom.isEnabledis also serialized as a string, usingtrueorfalse. -
Profile: Usesprofileto test the user's profile. -
GeoLocation: Usescity,country, andsubdivision. -
Domain: Usesdomain.
Default is also a valid criterion type. Do not confuse it with isDefaultAudience, which identifies whether the Audience component itself is the default audience.
For custom matching logic, formula refers to criterion identifiers rather than their position in the file. For example, (1 AND 2) OR 3 combines the criteria identified by criteriaNumber values 1, 2, and 3.
Target groups bundle related targets and audiences. Within a group, priority resolves which target is returned when the user matches multiple audiences. Changing an assignment in one Audience component can therefore require coordinated priority changes in another component.
Target limits include 2,000 groups, 500 targets per group, 2,500 ExperienceVariation targets, and 25,000 record targets.
Deployment and Retrieval
Audience components are stored in the audience folder with the .audience suffix. The type extends Metadata and inherits fullName. It supports the * wildcard in the package.xml manifest for deployment and retrieval.
Include ExperienceBundle in the package when deploying experience variation targets. The Audience component contains the assignment, while targetValue identifies the variation by developer name. For target naming details, see Salesforce's personalization naming guidance.
A supplied targets element replaces the assignment list; it is not a partial update. Use the following deployment patterns:
-
Update audience criteria or other settings without changing assignments: Omit
targetsentirely. - Add one assignment: Deploy the complete existing target list plus the new target.
- Remove one assignment: Deploy the complete target list without that target.
-
Remove every assignment: Supply an empty
targetselement, such as<targets></targets>. Omitting the element does not remove assignments. -
Change priorities: Deploy the complete list with revised
priorityvalues. If the change affects priority in another audience, deploy both audiences with their complete lists and revised priorities. - Move a target between audiences: Deploy both audiences with complete lists: remove the target from one list and add it to the other.
Removing target assignments does not delete the audience. Metadata API cannot delete an Audience component.
The default audience filename follows the pattern Default_Network Name.audience, where Network Name represents the network name. The isDefaultAudience element remains optional.
If no default audience exists, updating targets can make the UI incorrectly show a target as assigned to the default audience even though the API assignment data is correct. The workaround is to temporarily assign another target to the default audience and then remove that temporary assignment.
Relationships
Dependencies follow the audience's populated criteria, container, and target assignments. An audience can reference another audience, custom objects and fields, a custom permission, or a profile. The recognized container connections to CustomSite, ManagedTopics, and Network do not mean that every audience references all three.
References
-
Audience:audienceDeveloperName. -
CustomSite:container. -
ManagedTopics:container. -
Network:container. -
CustomField:entityField. -
CustomObject:entityType. -
CustomPermission:permissionName, when the permission criterion tests a custom permission. -
Profile:profile.
Referenced By
-
Audience:audienceDeveloperName.
Separate from these element references, an ExperienceVariation target has a developer-name association with content in ExperienceBundle, which must accompany deployments involving those targets. The default audience filename also has a name-based association with the network name; that filename pattern is not an additional XML reference element.
Reported Issues
-
Assignment details may need to be retrieved and deployed through Audience metadata, not just site files. In a 2020 response to a failed page-assignment migration, a respondent reported successfully migrating audiences and assignments through Metadata API with
Audiencein the manifest. The retrievedtargetentries contained the assignment details. This does not remove the requirement to includeExperienceBundlefor experience variation targets. Assignment migration report. -
Page-variation group and priority diagnosis can require inspecting the route in ExperienceBundle. A 2023 report identified
groupNameas the corresponding route ID shared by related page variations, andtargetValueas the variation'sdeveloperName. This is a reported mapping for page variations, not a universalgroupNameformat for every target type. Page-variation mapping discussion. -
An omitted variation JSON file was reported to prevent a complete assignment deployment. In 2026, a respondent troubleshooting component audience assignments reported resolving the problem by retrieving the entire site and including the variation JSON associated with the Audience file's
targetValuein the deployment. The report does not establish a universal conversion rule between developer names and JSON filenames. Associated site file workaround. - A missing Audiences interface in an enhanced Lightning Web Runtime (LWR) site may call for a different component-visibility configuration. In a 2023 discussion, an answer directed admins to Expression Based Visibility rules on the component's Visibility tab for showing or hiding individual components. That reported alternative should not be treated as confirmation that Audience page-variation assignments work the same way in LWR sites. LWR visibility discussion.
Common Questions
Can I deploy Audience page-variation assignments with Metadata API?
Yes. Assignments are stored under targets in the Audience component. Include ExperienceBundle for experience variation targets, and use the variation's developer name as targetValue. A supplied target list represents the complete desired assignment state.
How do I update an audience without changing its target assignments?
Omit targets entirely. An empty targets element has a different meaning: it removes every assignment from that audience.
Can I delete an Audience with Metadata API?
No. Metadata API cannot delete an Audience component. You can remove its target assignments by deploying an empty targets element, but the audience itself remains.
Why does the default audience show the wrong target assignment?
If no default audience exists, a target update can produce an incorrect default-audience assignment display in the UI while the API data remains correct. Temporarily assign another target to the default audience, then remove that temporary assignment.
Does audience targeting secure Salesforce data?
No. It changes browser-visible content, not underlying data access. Protect sensitive data with Salesforce security controls. A Permission criterion only tests whether the user already has the specified permission.