Opened 3 years ago

Closed 3 years ago

#2315 closed Bug (fixed)

calling piwikTracker.getVisitorId() early causes random ID to return, not persisted

Reported by: matt Owned by: matt
Priority: normal Milestone: Piwik 1.3
Component: Core Keywords:
Cc: Sensitive: no

Description

when calling JS API piwikTracker.getVisitorId() early (before the trackPageView() call) the returned ID will be a random one, not actually used by Piwik later. Instead, loadVisitorCookie should set the cookie when it's not already set.

Change History (4)

comment:1 Changed 3 years ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

(In [4462]) Fixes #2315 and updating tests (starting to love these JS tests ;)

comment:2 Changed 3 years ago by vipsoft (robocoder)

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:3 Changed 3 years ago by vipsoft (robocoder)

The code should only persist uuid (in a variable).

The current code fails for a new visitor when you call getVisitorId() and then trackPageView() because the saved cookie will incorrectly be treated as a return visitor.

comment:4 Changed 3 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [4475]) fixes #2315

Note: See TracTickets for help on using tickets.