[MAGNOLIA-8949] Visitor trait can't determine returning visitors Created: 13/Jun/23  Updated: 30/Jun/23

Status: Open
Project: Magnolia
Component/s: core
Affects Version/s: 6.2.26
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Brian Duffey Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

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.

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.



 Comments   
Comment by Brian Duffey [ 15/Jun/23 ]

Can someone please take a look at this issue? The workaround continuously produces a lot of errors in applications logs

 

ERROR info.magnolia.consent.cookie.impl.DefaultCookieManager 15.06.2023 10:47:21 -- Cookie 'NEW_VISITOR' can't be retrieved since it's not configured under '/modules/cookie-manager/config/cookies/NEW_VISITOR'

 @jnodarse

 

Comment by Nicholas Munoz [ 19/Jun/23 ]

@Laura Delnevo Can we have someone take a look at this ticket and prioritize for the near future? 

Thank you! 

cc @Brian Duffey 

Comment by Brian Duffey [ 30/Jun/23 ]

It was discovered that a visitor is considered as a new visitor during the Max-Age time of NEW_VISITOR cookie. By default it is 24 hours. It looks like it is expected behaviour of magnolia. So, we don’t need to disable NEW_VISITOR, but we need to configure it’s Max-Age attribute.

Generated at Mon Feb 12 04:37:15 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.