What is an audience?
An audience is a configuration that can be assigned to a user of the portal and that will allow to "filter" the objects that will be displayed during his navigation.
By objects, we mean:
documents
variants
assets
By default, users have access to everything that is shared on the portal.
The audience can therefore guarantee the confidentiality of certain documents, variants and assets.
Remember that an audience allows to filter objects, based on on or many attribute(s), but all the attributes of the allowed objects will be visible.
How does an audience work?
An audience should be seen as a filter applied to your portal during navigation.
Without an audience, the user will see all the objects displayed on your brand portal
With an audience, the user will see a some of these objects, i.e. :
Let's say that your portal distributes brand M1 and M2 documents.
If you create an audience that filters on the M1 brand, the users concerned will only see documents whose brand attribute has the value M1
What do I need to prepare before the configuration?
Before getting started, it is important to complete several steps.
Step 1: What filters do I want to apply to my document type?
This may sound silly, but it is important to define the need:
I want some users to be able to see only the "product" documents of the M1 brand
Step 2: What data do I need to create these filters?
Since I want to filter on the M1 brand, I need to have a data on my documents to perform this filter.
In this case, it appears that a mark attribute must be available on my documents and that it must have the value M1.
Next steps: I reiterate
Now that you've thought about your filters on the documents, I'm also going to ask myself the question for :
assets
variants
What is the format of an audience?
Basic structure
An audience consists of:
a name -- which will only be displayed in administration
a JSON configuration that defines the filters to apply
JSON has the following basis:
{
"asset": {},
"document": {
"produit": {},
"look": {}
},
"variant": {}
}
Here are the basic features:
An
asset
attribute will contain the filters to be applied to the displayed media. In this case, no filters will be applied (note that this is not necessarily a concern, since you may not want to filter on assets).
A
document
attribute will contain the filters to be applied on the documents, however, this filter must have a substructure for each type of document. In the example, we consider that your portal distributes two types of documents: products and looks.
A
variant
attribute will contain the filters to be applied on the displayed variants, in this case no filter will be applied.
Definition of a filter on an object
Let's keep the previous example:
I want some users to be able to see only the "product" documents of the M1 brand
Assuming that brand is a non-translatable text attribute and that it contains M1 on some documents, then the filter on the documents will be :
{
"asset": {},
"document": {
"produit": {
"attributes.brand": "M1",
},
"look": {}
},
"variant": {}
}
"attributes.brand"
indicates that we will filter on the brand attribute"M1"
indicates this attribute must have this value to display the document
The method will be the same for all document types and all object types.
Of course, the attribute used must be present on the object. It is not possible to filter the looks on the brand attribute.
Type of filters
If you are a developer and are familiar with the Quable API, you may have noticed that the above example looks very similar to the filters available on the v5 GET /documents
: https://docs.quable.com/reference/getdocumentcollection
It is therefore possible to filter on attributes, but also on tags...
Here are some examples according to the types of attributes: https://faq.quable.com/en/articles/6682112-how-audiences-filters-work-depenfing-on-json-attribute-type
For more information, please consult our online documentation:
Keywords : JSON, filters, audiences, portal