jkevan commented on pull request #265:
URL: https://github.com/apache/unomi/pull/265#issuecomment-804209534
Small update on what we discussed about in the call:
- Do not touch the unomi IncrementInterestAction. This action have his own
logic and cannot be generify with property incrementation, also the interest
incrementation from JExperience is not using this action, it's actually using a
script and the setPropertyAction.
- Create a new Action: IncrementPropertyAction:
- propertyName: to be able to increment or create a single prop
(properties.pageViewCount)
- rootPropertyName: to be able to increment all props under this one: (ex:
profile.properties.interest)
- incrementWithValues: to be able to increment properties with the values
coming from the event. (ex: event.properties.interest)
- storeInSession: to be able to target the profile or the session.
Real exemple coming from JEXperience:
the increment page count:
`"actions": [
{
"parameterValues": {
"setPropertyName": "properties.pageViewCount",
"setPropertyValue": "script::r =
profile.properties['pageViewCount']; if (r == null) {
profile.properties['pageViewCount'] = []; profile.properties.pageViewCount =
[event.scope : 1] } else { if (r[event.scope] != null) { r[event.scope] =
r[event.scope] + 1 } else { r[event.scope] = 1 }} r",
"storeInSession": false
},
"type": "setPropertyAction"
}
]`
We should be able to do it with this kind of conf:
type: incrementPropertyAction
paramerterValues:
- propertyName: properties.pageViewCount
- storeInSession: false
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]