recordAction()

Overview

public string function recordAction(
      required string action    
    , required string type      
    ,          string userId     = ""
    ,          string identifier = ""
    ,          any    detail    
)

Records an action for the given user

Arguments

NameTypeRequiredDescription
actionstringYesID of the action to record, e.g. 'logout'
typestringYesType of the action to record, e.g. 'login'
userIdstringNo (default="")ID of the user to record the action for
identifierstringNo (default="")Unique identifier to the subject of the action, e.g. a page ID for a 'pagevisit' action
detailanyNoAdditional detail to record with the action, will be serialized to JSON when saved in the DB