Frequency capping not working with Ranking Formulas
We want to cap the amount of personalised offers that a user is seeing in the webpage. We used custom code channel.
We created a campaign with a ranking formula and a decision policy. Inside the policy we added the frequency capping and set it to 3 displays per user per day.
We followed this documentation:
https://experienceleague.adobe.com/en/docs/journey-optimizer-learn/frequency-capping-in-ajod/enable-capping
We enabled the itemId and the trackingTockens and we are properly sending and collecting those in the web page and Tags. All the info is reaching AEP, this is a display event.
"_experience": {
"decisioning": {
"propositionAction": {
"tokens": [
"/vCRDDlX6uR7PIti7nB11w"
],
"id": "dps:689105eb84a0ad4b943aa2d8967e7f09b45b034ee8a9f539:1c1087fec9796bcb"
},
"propositions": [
{
"scopeDetails": {
"rank": 1,
"correlationID": "3fe24028-0466-4b29-a056-3f5ea8b5009d-0",
"decisionProvider": "AJO",
"activity": {
"priority": 1,
"matchedSurfaces": [
"web://bank-demo-project.vercel.app/#hero-banner"
],
"id": "cd21f43f-92dd-4444-94fa-504d5979aee7#cf8ba0b7-2cbe-44ed-bd10-f13d21609eca"
}
},
"id": "144bb7d0-0738-4b9b-b277-c60bbdb20c68",
"items": [
{
"id": "cf19f46b-23e8-40de-aeb9-f2f18b8b4fc7"
}
],
"scope": "web://bank-demo-project.vercel.app/#hero-banner"
},
{
"scopeDetails": {
"decisionProvider": "EXD",
"rank": 1,
"strategies": [
{
"strategyID": "8aa3740d-f34a-4d5e-b0db-235a2eade5da",
"step": "decisionPolicy"
},
{
"strategyID": "web://bank-demo-project.vercel.app/#hero-banner",
"step": "placement"
}
],
"activity": {
"priority": 1,
"matchedSurfaces": [
"web://bank-demo-project.vercel.app/#hero-banner"
],
"id": "cd21f43f-92dd-4444-94fa-504d5979aee7#cf8ba0b7-2cbe-44ed-bd10-f13d21609eca"
},
"correlationID": "3fe24028-0466-4b29-a056-3f5ea8b5009d-0"
},
"id": "72348d6e-6ae9-4652-993e-a01e27269e2b",
"items": [
{
"name": "UC6 | Account creation | Investment",
"score": 101,
"id": "dps:689105eb84a0ad4b943aa2d8967e7f09b45b034ee8a9f539:1c1087fec9796bcb",
"itemSelection": {
"rankingDetail": {
"strategyID": "dps:ranking-function:1c108cb9e8d520dd",
"step": "formula"
},
"selectionDetail": {
"strategyName": "UC6 | Account creation",
"selectionType": "selectionStrategy",
"strategyID": "dps:selection-strategy:1c108d16b22904b6",
"version": "latest"
}
}
}
],
"scope": "web://bank-demo-project.vercel.app/#hero-banner"
}
],
"propositionEventType": {
"display": 1
}
}
},The problem is that the user is always seeing the same offer.
Just in case, I will attach the ranking formula too:
let offerName = offer._experience.decisioning.decisionitem.itemName in
let priority = offer._experience.decisioning.decisionitem.itemPriority in
let hasTag = offer._experience.decisioning.decisionitem.itemTags.intersects(["3eb0e4e7-725e-45ca-bfe4-8e4e5c4b5ab6"]) in
let mainName = _capgeminiamerptrsd.bankAccount.mainAccount.financialAccountName in
let savingsName = _capgeminiamerptrsd.bankAccount.savingsAccount.financialAccountName in
let hasMain = mainName.isNotNull() in
let hasSavings = savingsName.isNotNull() in
if(
hasTag,
if(
hasMain AND hasSavings AND offerName = "UC6 | Account creation | Investment",
priority + 100,
if(
hasMain AND (NOT hasSavings) AND offerName = "UC6 | Account creation | Savings",
priority + 50,
if(
(NOT hasMain) AND (NOT hasSavings) AND offerName = "UC6 | Account creation | Checking",
priority + 20,
priority
)
)
),
priority
)