[Legado]{class="badge informative"}
Fórmulas de classificação create-ranking-formulas
Sobre fórmulas de classificação about-ranking-formulas
Fórmulas de classificação permitem definir regras que determinam qual oferta deve ser apresentada primeiro para uma determinada inserção, em vez de considerar as pontuações de prioridade das ofertas. As fórmulas de classificação são expressas em sintaxe PQL e podem aproveitar atributos de perfil, dados de contexto e atributos de oferta. Para obter mais informações sobre como usar a sintaxe do PQL, consulte a documentação dedicada.
Depois que uma fórmula de classificação é criada, é possível atribuí-la a uma inserção em uma decisão. Para obter mais informações, consulte Configurar seleção de ofertas em decisões.
Criar uma fórmula de classificação create-ranking-formula
Para criar uma fórmula de classificação, siga as etapas abaixo:
-
Acesse o menu Componentes e selecione a guia Classificação. A guia Fórmulas é selecionada por padrão. A lista de fórmulas criadas anteriormente é exibida.
-
Clique em Criar classificação para criar uma nova fórmula de classificação.
-
Especifique o nome, a descrição e a fórmula da fórmula.
Neste exemplo, queremos aumentar a prioridade de todas as ofertas com o atributo “quente” se o tempo real estiver quente. Para fazer isso, o contextData.weather=hot foi passado na chamada de decisão. Saiba como trabalhar com dados de contexto
note important IMPORTANT Ao criar uma fórmula de classificação, a retrospectiva para um período anterior não é compatível. Por exemplo, se você especificar um evento de experiência que ocorreu no último mês como um componente da fórmula. Qualquer tentativa de incluir um período de lookback durante a criação de uma fórmula acionará um erro ao salvá-la. -
Clique em Salvar. Sua fórmula de classificação é criada, você pode selecioná-la na lista para obter detalhes e editá-la ou excluí-la.
Agora ele está pronto para ser usado em uma decisão para classificar ofertas qualificadas para um posicionamento (consulte Configurar seleção de ofertas em decisões).
Exemplos de fórmula de classificação ranking-formula-examples
Você pode criar muitas fórmulas de classificação diferentes de acordo com suas necessidades. Abaixo estão alguns exemplos.
Aumente as ofertas com determinado atributo de oferta com base no atributo de perfil
Se o perfil estiver na cidade correspondente à oferta, duplique a prioridade para todas as ofertas nessa cidade.
Fórmula de classificação:
if( offer.characteristics.get("city") = homeAddress.city, offer.rank.priority * 2, offer.rank.priority)
Impulsione ofertas em que a data final seja anterior a 24 horas a partir de agora
Fórmula de classificação:
if( offer.selectionConstraint.endDate occurs <= 24 hours after now, offer.rank.priority * 3, offer.rank.priority)
Aumente as ofertas com base na propensão do cliente para comprar o produto oferecido
Você pode aumentar a pontuação de uma oferta com base em uma pontuação de propensão do cliente.
Neste exemplo, o locatário da instância é _salesvelocity e o esquema de perfil contém um intervalo de pontuações armazenadas em uma matriz:
Diante disso, para um perfil como:
{"_salesvelocity": {"individualScoring": [
{"core": {
"category":"insurance",
"propensityScore": 96.9
}},
{"core": {
"category":"personalLoan",
"propensityScore": 45.3
}},
{"core": {
"category":"creditCard",
"propensityScore": 78.1
}}
]}
}
As ofertas conteriam um atributo para propensityType que corresponde à categoria das pontuações.
Sua fórmula de classificação pode então definir a prioridade de cada oferta para igualar a propensityScore do cliente para esse propensityType. Se nenhuma pontuação for encontrada, use a prioridade estática definida na oferta.
Fórmula de classificação:
let score = (select _Individual_Scoring1 from _salesvelocity.individualScoring
where _Individual_Scoring1.core.category.equals(offer.characteristics.get("propensityType"), false)).head().core.propensityScore
in if(score.isNotNull(), score, offer.rank.priority)
Aumentar ofertas com base em dados de contexto context-data
Journey Optimizer permite que você impulsione determinadas ofertas com base nos dados de contexto que estão sendo transmitidos na chamada. Por exemplo, se contextData.weather=hot for passado, a prioridade de todas as ofertas com attribute=hot deverá ser aumentada. Para obter informações detalhadas sobre como transmitir dados de contexto usando as APIs de Decisão do Edge e Decisão, consulte esta seção
Observe que ao usar a API Decisão, os dados de contexto são adicionados ao elemento do perfil no corpo da solicitação, como no exemplo abaixo.
"xdm:profiles": [
{
"xdm:identityMap": {
"crmid": [
{
"xdm:id": "CRMID1"
}
]
},
"xdm:contextData": [
{
"@type":"_xdm.context.additionalParameters;version=1",
"xdm:data":{
"xdm:weather":"hot"
}
}
]
}],
Estes são exemplos ilustrando como usar dados de contexto em fórmulas de classificação para aumentar a prioridade das ofertas. Expanda cada seção para obter detalhes sobre a sintaxe da fórmula de classificação.
<OrgID> pela ID de locatário da organização.| tabs | |
|---|---|
| API de decisão | if (@{_xdm.context.additionalParameters;version=1}.channel.isNotNull() and @{_xdm.context.additionalParameters;version=1}.channel.equals(_abcMobile.preferredChannel), offer.rank.priority + 10, offer.rank.priority) |
| API do Edge Decisioning | if (xEvent.<OrgID>.channel.isNotNull() and xEvent.<OrgID>.channel.equals(_abcMobile.preferredChannel), offer.rank.priority + 10, offer.rank.priority) |
| tabs | |
|---|---|
| API de decisão | if (@{_xdm.context.additionalParameters;version=1}.weather.isNotNull() and offer.characteristics.get("weather")=@{_xdm.context.additionalParameters;version=1}.weather, offer.rank.priority + 5, offer.rank.priority) |
| API do Edge Decisioning | if (xEvent.<OrgID>.weather.isNotNull() and offer.characteristics.get("weather")=xEvent.<OrgID>.weather, offer.rank.priority + 5, offer.rank.priority) |
| tabs | |
|---|---|
| API de decisão | if (@{_xdm.context.additionalParameters;version=1}.contentorigin.isNotNull() and offer.characteristics.contentorigin=@{_xdm.context.additionalParameters;version=1}.contentorigin, offer.rank.priority * 100, offer.rank.priority) |
| API do Edge Decisioning | if (xEvent.<OrgID>.contentorigin.isNotNull() and offer.characteristics.contentorigin=xEvent.<OrgID>.contentorigin, offer.rank.priority * 100, offer.rank.priority) |
| tabs | |
|---|---|
| API de decisão | if (@{_xdm.context.additionalParameters;version=1}.weather.isNotNull() and offer.characteristics.weather=@{_xdm.context.additionalParameters;version=1}.weather, offer.rank.priority * offer.characteristics.scoringBoost, offer.rank.priority) |
| API do Edge Decisioning | if (xEvent.<OrgID>.weather.isNotNull() and offer.characteristics.weather=xEvent.<OrgID>.weather, offer.rank.priority * offer.characteristics.scoringBoost, offer.rank.priority) |
This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.
For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.
- TL;DR: This page explains how to create ranking formulas, expressed in PQL syntax, that determine which offer is presented first for a placement in the legacy Decision Management capability, with example formulas.
Intents:
- Create a ranking formula from the Ranking tab of the Components menu by specifying its name, description, and formula.
- Select an existing ranking formula from the list to get details and edit or delete it.
- Assign a ranking formula to a placement in a decision to rank eligible offers for that placement.
- Write a ranking formula that boosts offers based on profile attributes, offer attributes, or an offer end date.
- Write a ranking formula that boosts offers based on context data passed in the Decisioning API or Edge Decisioning API call.
Glossary:
- Ranking formula (product-specific): A rule, expressed in PQL syntax, that determines which offer should be presented first for a given placement, rather than taking into account the offers’ priority scores. A ranking formula can leverage profile attributes, context data, and offer attributes.
Guardrails:
- When creating a ranking formula, looking back into a previous period of time is not supported (for instance, specifying an experience event that occurred within the last month as a component of the formula). Any attempt to include a lookback period during formula creation triggers an error when saving the formula.
Terminology:
- Canonical name: Ranking formula — variants: ranking formulas
- Do not confuse: “Decision Management” (the legacy capability this page covers) ≠ “Decisioning” (the new capability, with its own ranking formulas page).
- Do not confuse: “Decisioning API” ≠ “Edge Decisioning API”. In the context data examples, the Decisioning API formulas read context data with
@{_xdm.context.additionalParameters;version=1}, while the Edge Decisioning API formulas read it withxEvent.<OrgID>.
FAQ:
- Where do I create a ranking formula? Access the Components menu, then select the Ranking tab. The Formulas tab is selected by default and shows the list of previously created formulas. Select Create ranking.
- What can a ranking formula leverage? Ranking formulas are expressed in PQL syntax and can leverage profile attributes, context data, and offer attributes.
- Can a ranking formula look back into a previous period of time? No. Looking back into a previous period of time is not supported, and including a lookback period triggers an error when saving the formula.
- How do I use a ranking formula once it is created? Assign it to a placement in a decision, where it is used to rank eligible offers for that placement.
- How is context data added when using the Decisioning API? The context data is added to the profile element in the request body, in
xdm:contextDatawith"@type":"_xdm.context.additionalParameters;version=1"and the values underxdm:data. - What do I replace
<OrgID>with in the Edge Decisioning API examples? Replace<OrgID>with your Organization Tenant ID.
Examples:
- Boost offers with a certain offer attribute based on a profile attribute: if the profile lives in the city corresponding to the offer, double the priority for all offers in that city:
if( offer.characteristics.get("city") = homeAddress.city, offer.rank.priority * 2, offer.rank.priority). - Boost offers where the end date is less than 24 hours from now:
if( offer.selectionConstraint.endDate occurs <= 24 hours after now, offer.rank.priority * 3, offer.rank.priority). - Boost offers based on a customer propensity score: with the tenant
_salesvelocityand scores stored in theindividualScoringarray of the profile schema, offers contain apropensityTypeattribute that matches the score category. The formula sets the priority of each offer to the customer’spropensityScorefor thatpropensityType, and uses the static priority set on the offer if no score is found. - Boost the offer priority by 10 if the channel from context data matches the customer’s preferred channel (Decisioning API):
if (@{_xdm.context.additionalParameters;version=1}.channel.isNotNull() and @{_xdm.context.additionalParameters;version=1}.channel.equals(_abcMobile.preferredChannel), offer.rank.priority + 10, offer.rank.priority). - The same boost with the Edge Decisioning API:
if (xEvent.<OrgID>.channel.isNotNull() and xEvent.<OrgID>.channel.equals(_abcMobile.preferredChannel), offer.rank.priority + 10, offer.rank.priority). - Content Origin Boost (Decisioning API):
if (@{_xdm.context.additionalParameters;version=1}.contentorigin.isNotNull() and offer.characteristics.contentorigin=@{_xdm.context.additionalParameters;version=1}.contentorigin, offer.rank.priority * 100, offer.rank.priority). - Weather Boost (Edge Decisioning API):
if (xEvent.<OrgID>.weather.isNotNull() and offer.characteristics.weather=xEvent.<OrgID>.weather, offer.rank.priority * offer.characteristics.scoringBoost, offer.rank.priority).
Related pages:
- If you are using the new Decisioning capability: Ranking formulas
- To find out which capability you are using: Learn about Decisioning
- To assign a ranking formula to a placement in a decision: Configure offers selection in decisions
- To work with context data and pass it using the Edge Decisioning and Decisioning APIs: Learn how to work with context data
Personas:
- marketer: Can create a ranking formula from the Ranking tab of the Components menu by specifying the formula name, description, and formula, then selecting Save. Can select a ranking formula from the list to get details and edit or delete it. Can assign a ranking formula to a placement in a decision to rank eligible offers for that placement. The page states that any attempt to include a lookback period during formula creation will trigger an error when saving it. Where: “Create a ranking formula”.
Onboarding:
- Level: Intermediate
- First minimal step: Access the Components menu, then select the Ranking tab.
- Success check: Your ranking formula is created, and you can select it from the list to get details and edit or delete it.
- Next: Once a ranking formula has been created, to assign it to a placement in a decision: Configure offers selection in decisions