Hi,
I am trying to find out more about session and action property.
Understand that for web application, there is RUM JavaScript API for me to add session and action property through sendSessionProperties and addActionProperties().
And for mobile, i can use reportValue.
Hence i would like to ask if they function the same way?
Adding Session Property
- Web:
var js_role = { js_role: "staff" };
window.dtrum.sendSessionProperties(null, null, js_role);
- Mobile:
Dynatrace.reportStringValue("js_role", "staff");
Add Action Property
- Web
var rating;
function submitForm(value) {
fetch('https://example.com/submit')
.then(response => response.json())
.then(data => {
if (typeof dtrum === "undefined") return;
// Add Action Listener
rating = { js_rating: value };
window.dtrum.addEnterActionListener(addRatingToAction);
// Add Custom Action
var submtitForm = window.dtrum.enterAction('Submit Form');
window.dtrum.leaveAction(submtitForm);
// Remove Action Listener
window.dtrum.removeEnterActionListener(addRatingToAction);
})
.catch(error => {
console.error('API Error:', error);
});
}
// Add Action Properties
function addRatingToAction(actionId) {
window.dtrum.addActionProperties(actionId, null, null, rating);
}
- Mobile
let myAction = Dynatrace.enterAutoAction("Submit Form");
myAction.reportStringValue("js_rating", value);
myAction.leaveAction();
- is this correct?
Thanks.