View and inspect audience details
Use View code and Inspect in Audience builder to review how an audience is defined.
These options are useful when you want to check the audience rules, review rule groups, or inspect the full audience configuration.
View the audience code
Use View code to review how the audience rules are represented as generated code and JSON.
To view the audience code:
-
In the navigation menu, click Performance.
-
In the left-hand pane, select Audiences.
-
On the Audiences page, open the audience you want to view.
-
In Audience builder, at the top-right corner of the page, click the horizontal ellipsis icon
, then click View code.The Generated code dialog opens.
-
Review the following tabs:
-
Transpiled code - shows the generated logic used by SitecoreAI to process the audience rules.
For example, in the UK and Ireland audience, the following transpiled code checks whether:
-
the profile has a session where the country is Ireland or the continent is Europe.
-
the profile has a session created within the past 30 days.
Because the rule groups are joined with Or, the profile belongs to the audience if either rule group matches.
-
-
Definition JSON - shows the same audience rule structure in JSON format.
For example, in the UK and Ireland audience, it shows:
-
a top-level OR operator.
-
one rule group for session location rules.
-
one rule group for sessions created within the past 30 days.
-
the selected session attributes, comparators, and values used in each rule.
-
-
Inspect the audience details
Use Inspect to review the full audience configuration in more detail, including metadata, rule definitions, generated logic, and configuration details.
To inspect the audience details:
-
In the navigation menu, click Performance.
-
In the left-hand pane, select Audiences.
-
On the Audiences page, open the audience you want to inspect.
-
In Audience builder, at the top-right corner of the page, click the horizontal ellipsis icon
, then click Inspect.The Inspect audience dialog opens.
-
Review the following views:
-
JSON view - shows the complete audience configuration in JSON format. This view includes technical details such as:
-
audience metadata, such as name, status, revision, created date, and modified date.
-
audience rules and rule groups.
-
attributes, operators, and values used in each rule.
-
generated logic used to process the audience rules.
This view is useful when you need complete technical details about the audience configuration or when troubleshooting audience setup.
For example, the following JSON view for the UK and Ireland audience shows:
-
the audience name and status.
-
the top-level
ORoperator. -
one rule group for session location rules.
-
one rule group for sessions created within the past 30 days.
-
the generated logic for processing the audience rules.
-
-
Table view - displays the same audience definition in a more readable format.
For example, for the UK and Ireland audience, the table view helps you confirm that the audience includes profiles who match either the session location rules or the session created date rule.
-