I have a content node called Home that's configured to have two separate personalisation groups: PartnerPath & SupplierPath. I was able to get the total score for both of them on the Home node. However, I'd need to get the individual score for each path to see which score is higher and display different content based on the score. I've tried looping through the groups and used ScoreForVisitor() for each path but the result is 0. Want to double check if that's the correct approach or is there any other way to get this value?
Hi - I've built and generally used this package as a way to personalise between nodes (e.g. with a list of picked nodes or nested content, show/hide or re-order items based on whether they should be shown or their scores.
That said, I had a PR a while back adding what I think is what you are looking for.
There's an extenion method on the Umbraco helper, so you can do Umbraco.ScoreForVisitor(groups), where groups is a collection of the groups the visitor is associated with. Although that accepts a collection, it could be a collection of 1 element - so I think you could loop through the groups associated with your home page, and for each iteration call this method passing new List<IPublishedContent> { group }; to get the score for each single group.
Individual Personalisation Group Score
Hi,
I have a content node called Home that's configured to have two separate personalisation groups: PartnerPath & SupplierPath. I was able to get the total score for both of them on the Home node. However, I'd need to get the individual score for each path to see which score is higher and display different content based on the score. I've tried looping through the groups and used ScoreForVisitor() for each path but the result is 0. Want to double check if that's the correct approach or is there any other way to get this value?
https://drive.google.com/file/d/1MwGPccQtb7IiBxhm5s3nI73u2Z3qKO94/view?usp=sharing
Thanks
Hi - I've built and generally used this package as a way to personalise between nodes (e.g. with a list of picked nodes or nested content, show/hide or re-order items based on whether they should be shown or their scores.
That said, I had a PR a while back adding what I think is what you are looking for.
There's an extenion method on the Umbraco helper, so you can do
Umbraco.ScoreForVisitor(groups)
, where groups is a collection of the groups the visitor is associated with. Although that accepts a collection, it could be a collection of 1 element - so I think you could loop through the groups associated with your home page, and for each iteration call this method passingnew List<IPublishedContent> { group };
to get the score for each single group.Not 100% sure but I think that should work.
Andy
Thanks Andy,
It's working as expected.
is working on a reply...