Real User Monitoring
User session monitoring, key user actions - everything RUM.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

addActionProperty does not work in Dynatrace tenant runs on RUM Classic Gen2 without DPS licensing

mkarmocha
Participant

I am trying to capture User Action using addAction, addActionProperty, leaveAction, however the addActionProperty does not work, though I created Javascript Variable for the properties i am passing in addActionProperty.

How did I create;
Click on Application > Edit > Capturing > Session and action Properties > Add Property > Custom defined property.

And then I chose Javascript Variable put other details.

My code below;
const dtrum = window?.dtrum;
if (!dtrum) {
logger.info(`trackCustomUserAction (dtrum API undefined) actionName=[${actionName}] `);
return;
}

const actionId = dtrum.enterAction('feature_initialized’);


if (properties && typeof dtrum.addActionProperties === 'function') {
dtrum.addActionProperties(actionId, null, null, {status, action});
}

dtrum.leaveAction(actionId);

So when my code is executed the values does not seems to be logged in dynatrace.

However, if i set property values in global windows then Dynatrace UI grabs the value and logs the status and action for the user. Below ithe working code

const actionId = dtrum.enterAction('feature_initialized’);

//Created Javascript variable in Session and User Property
// capture expression named as DT_OBSERVABILITY
// assigning it in global window, so that dynatrace UI could capture value
window.POC = window.POC || {};
window.POCstatus = values?.status ?? '';
window.POC.action = values?.action ?? '';
dtrum.leaveAction(actionId);

I am trying to understand why addActionProperty does not work, is it related to Our Dynatrace tenant runs on RUM Classic Gen2 without DPS licensing. I see that we do not have experience vital and user events available. Could someone help clarify as I need to document this as I am trying to log user actions in our web application

2 REPLIES 2

wkimchan
Participant

The issue is here: 


And then I chose Javascript Variable put other details.

Choosing "Javascript variable" will lead to the behaviour you mentioned here: 

However, if i set property values in global windows then Dynatrace UI grabs the value and logs the status and action for the user. 

 What you want is to select "JavaScript API" instead.

thanks it is resolved now

Featured Posts