Remove TargetGroup from user

Hi,

we have implemented a custom target group condition based on cookie data.
It works fine when we add data and trigger a TargetGroupEvent. The Target group gets added to the user as it should. But when we remove cookie data and trigger the event the Targetgroup is not removed from the user.
If we restart the site the targetgroups that dont match the cookies are removed.
I found a workaround. By removing the targetgroup data in the session and then trigger the event i get the correct targetgroups but I guess this isn’t an optimal solution.
Do you have any suggestions how to solve this in a correct way?

ref: https://docs.litium.com/documentation/litium-documentation/customers/target-groups

Litium version: 7.2

What are you returning in your ITargetGroupCondition.GetProcessAction?

TargetGroupProcessAction.Add

/Niclas

Try to switch that one to return TargetGroupProcessAction.Remove, also the ITargetGroupCondition.AllowsMultipleActions need to return true. Then you condition will be executed even if the user already is in the target group and you can let the condition remove itself from the current lists of applied target groups.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.