Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Truyen 9 posts 110 karma points
    Mar 08, 2021 @ 16:28
    Truyen
    0

    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

  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Mar 09, 2021 @ 13:50
    Andy Butland
    100

    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.

    Not 100% sure but I think that should work.

    Andy

  • Truyen 9 posts 110 karma points
    Mar 09, 2021 @ 21:03
    Truyen
    0

    Thanks Andy,

    It's working as expected.

Please Sign in or register to post replies

Write your reply to:

Draft