Body

Keep in mind Unomi does not combine scores when profiles are merged.

Tracking targets

In this example we will set up Unomi to keep track of scoring for visitors of dxp and agency, so we can then create segments for marketeers and technical profiles to categorise the visitors.

Snippet

We use this snippet to increase or decrease the score based on the target page. If the visitor interacts (event) with a dxp page, the score for tech will increase and decrease for marketeer. If the visitor interacts (event) with an agency page, the score for marketeer will increase and decrease for tech.

<script>
    // enable namespace that handles the queue and methods
    window.dsdc = window.dsdc || function () { (dsdc.q = dsdc.q || []).push(arguments) }; dsdc.l = +new Date;

    // enable scoring
    window.dsdc('beforeRequest', function (data) {

        // temporary store our capture data & potential merge value
        var changedCapture = data.requestData;

        // check if the visitor interacted with a dxp page
        if (changedCapture.te__target == "dxp") {
            // increase score for tech and decrease for marketeer
            changedCapture.scoring = {
                "targets": {
                    "tech": {
                        "te__operator": "+",
                        "te__value": "1"
                    },
                    "marketeer": {
                        "te__operator": "-",
                        "te__value": "1"
                    }
                }
            };
        }

        // check if the visitor interacted with an agency page
        if (changedCapture.te__target == "agency") {
            // increase score for marketeer and decrease for tech
            changedCapture.scoring = {
                "targets": {
                    "tech": {
                        "te__operator": "-",
                        "te__value": "1"
                    },
                    "marketeer": {
                        "te__operator": "+",
                        "te__value": "1"
                    }
                }
            };
        }

        // use a global function to pass the modified capture back to the main script  
        dsdc.updateCapture(changedCapture);
    });
</script>

Segment

These scoring properties will be available when creating a segment when at least one profile has the scoring properties, so we click once on the starting page of dxp in order for the scoring to get in a profile.

Now that Unomi has these scores, we can create segments to start categorizing the visitors.

We start by creating a segment for marketeers. Here we add a rule which checks if the highest scoring name is marketeer, so if the score for marketeer is higher than tech in the targets group Unomi will assign this segment to the visitor.

We continue by creating a segment for technical profiles. Here we add a rule which checks if the highest scoring name is tech, so if the score for tech is higher than marketeer in the targets group Unomi will assign this segment to the visitor.

Now that we have segments for both our target groups, we can test them out.

Test

We go to an agency page and interact with the page by clicking around a few times. By inspecting the page, we see that Unomi assigned the marketeer segment to our profile.

Next, we go to a Drupal webinar page and interact with it more than we did on the other page. By inspecting the page, we see Unomi removed the marketeer segment from our profile and assigned the tech segment instead.

Target groups can now get more relevant personalized content!