How do define Unomi segments based on events

92 Views Asked by At

I want to define a Unomi segment that is based on page views, for example, "user has viewed a page with a category value of 'foo'" or 'user had viewed a page on the site with ID 'bar'".

I can't figure out how the Unomi data architecture connects profiles with events.

I've tried creating segments with an eventPropertyCondition and scorings with an eventPropertyCondition, and neither of them produce any results:

"type": "eventPropertyCondition",
"parameterValues": {
    "propertyName": "target.properties.pageInfo.categories",
    "comparisonOperator": "contains",
    "propertyValue": "cake"
}

What am I missing? It seems to me there's something fundamental about the Unomi data architecture that I don't understand.

1

There are 1 best solutions below

0
On

Figured it out!

Define a segment with a pastEventCondition:

    "condition": {
        "type": "pastEventCondition",
        "parameterValues": {
            "operator": "eventsOccurred",
            "minimumEventCount": 1,
            "numberOfDays": 365,
            "eventCondition": {
                "type": "eventPropertyCondition",
                "parameterValues": {
                    "propertyName": "target.properties.pageInfo.categories",
                    "comparisonOperator": "contains",
                    "propertyValue": "cake"
                }
            }
        }
    },