The kissmetrics_user_id() function can be improved in a couple of areas:

  • It currently prioritizes the UID of logged in users over the SID provided by the Session API module which prevents it from tracking users between log in/out.
  • It doesn't support the Session Cache module which provides a pluggable data storage mechanism, allows users to be tracked between browsers and can be configured to use the UID of an authenticated user as the SID.
  • There is no way to choose which ID provider to use when two or more provider modules are enabled.
  • There is no way to create a custom ID provider.
  • It doesn't take advantage of drupal_hash_base64() to simplify the ID generation process for anonymous users if no session module is installed.

Comments

devin carlson’s picture

Status: Active » Needs review
StatusFileSize
new6.09 KB

A patch to address the issues in the OP by allowing for custom ID providers and providing an interface for for selecting between available providers. Support for the Session API and Session Cache modules is included out of the box.

devin carlson’s picture

StatusFileSize
new6.09 KB

An updated patch that fixes an issue where the currently configured ID provider is not found in the array of available providers.

devin carlson’s picture

A new patch which reuses the identities set by the JavaScript library and to only identify/alias users as necessary when they first log in.

devin carlson’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.