cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Session property for web vs mobile application

Weilin1
Participant

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.

2 REPLIES 2

radek_jasinski
DynaMight Guru
DynaMight Guru

Hi @Weilin1 

In general, sendSessionProperties and addActionProperties in web applications and reportValue in mobile applications serve a similar purpose of enriching session and action data with custom properties, they are tailored to the specific requirements and best practices of web and mobile platforms respectively.

Radek

Have a nice day!

Julius_Loman
DynaMight Legend
DynaMight Legend

Just for the record - for web apps, you won't see any values until properties are configured for the web application in Dynatrace. For mobile applications it's different, you will still see the values in user action waterfall screens (very convenient and useful), and they will act as user action property just after you defined them. That's why the difference - sendActionProperties vs. reportValue.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner