-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
6.2.26
-
None
Steps to reproduce
- Create any component for on any page
- Add variant for the component
- Set audience for this component
- Add Visitor trait and choose "Returning"
- Navigate tho the page and see results
- Notice that component variant for "Returning" visitor is never shown
Expected results
Returning visitors should be determined by the Visitor trait.
Actual results
Returning visitors are not identified by the Visitor trait.
Workaround
Disable NEW_VISITOR cookie in the Cookies app.
Development notes
It happens because of the logic inside the
info.magnolia.personalization.visitor.VisitorDetectorFilter java class. It sets NEW_VISITOR cookie, it is never removed, but visitor status is determined by this line
Visitor.Status status = (!newVisitorCookie.isPresent() && visitorCookie.isPresent() && Visitor.RETURNING.equals(visitorCookie.get().getValue())) ? Visitor.Status.RETURNING : Visitor.Status.NEW;
where newVisitorCookie.isPresent() is always true. As result the visitor's status is always NEW.
Acceptance criteria