Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8949

Visitor trait can't determine returning visitors


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 6.2.26
    • core
    • None

      Steps to reproduce

      1. Create any component for on any page
      2. Add variant for the component
      3. Set audience for this component
      4. Add Visitor trait and choose "Returning"
      5. Navigate tho the page and see results
      6. 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.


      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

              Unassigned Unassigned
              bduffey Brian Duffey
              1 Vote for this issue
              2 Start watching this issue


                  Bug DoR
                  Task DoD