I have a requirement to track how many users successfully logged in to my website along with their metadata e.g. their Role, Designation (that comes from the back-end and is available at the client side(Javascript) of the application).
I am using a DirectCall rule in DTM in the Login function's(Ajax call) Success callback where I capture user's username, name, designation and other related info which I want to track.
I have created a dataLayer like this:
dataLayer= {
'pagename':pageName,
'loggedInUser' : username,
'designation' : designation,
'UserRole' : role
}
I have captured this information in separate custom eVars and have to show this in a tabular format as shown below:
UserName | Designation | UserRole | No.Of Views
How can this be achieved? Is my approach right, or I can use some predefined eVars or mechanism in place?