• Forums
    • Public Forums
      • Community Connect
      • Dynatrace
        • Dynatrace Open Q&A
      • Application Monitoring & UEM
        • AppMon & UEM Open Q&A
      • Network Application Monitoring
        • NAM Open Q&A
  • Home /
  • Public Forums /
  • Dynatrace /
  • Dynatrace Open Q&A /
avatar image
Question by Babar Q. · Jul 02, 2020 at 11:15 AM · extensions RUM user session monitoring mobile monitoring

Hybrid Mobile User Sessions and Web Requests/User Actions

Dear All,

We recently instrumented a hybrid mobile application using the Cordova plugin to have the Mobile RUM (external) performance data.

Now the following things bothering me:

  • Top web requests appearing under the network performance > top providers > our publically available external, which cannot correlate to any user session.
  • Secondly, the user session details are showing only the below events and actions.

Regards,

Babar

1593688291947.png (17.1 KiB)
1593688308002.png (17.1 KiB)
Comment

People who like this

0 Show 0
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

2 Replies

  • Sort: 
  • Most voted
  • Newest
  • Oldest
avatar image

Answer by Matthias H. · Jul 07, 2020 at 06:12 AM

If you want to have more visibility there is currently a workaround possible:


async makeRequest() {
	// Set Mobile dtAdk cookie because native web request don't add cookies
	this.http.setCookie("YOUR_URL", "dtAdk=" + this.getCookieValue("dtAdk"));
	// Create XHR Action via JavaScript OneAgent
	let actionId = dtrum.enterXhrAction("Mobile First HTTP", XhrActionMode.CREATE_ACTION_WITH_USER_INPUT, 'YOUR_URL');
	// Make HTTP Request with x-dtpc, x-dtreferer and x-dynatrace header
	await this.http.get('YOUR_URL', {}, { "x-dtpc": this.getCookieValue("dtPC"), "x-dtreferer": dT_.gAR(actionId), "x-dynatrace": "" });
	// Leave XHR After request is done
	dtrum.leaveXhrAction(actionId);
}

getCookieValue(a) {
	var b = document.cookie.match('(^|[^;]+)\\s*' + a + '\\s*=\\s*([^;]+)');
	return b ? b.pop() : '';
}


this.http is the http library where you are firing the web requests. Basically this snippet does the following:

  1. Set the current dtAdk Cookie onto the URL where the request happens (This can be changed to the domain and not the URL directly)
  2. JS Agent is creating an XHR Action
  3. Web Request will be tagged with 3 dynatrace related headers (x-dtpc, x-dtreferer, x-dynatrace)
  4. Leave the XHR Action


Result: You have an XHR Action in the User session with a web request which is linked to the server side.

Comment
Maciej N.
Babar Q.

People who like this

2 Show 3 · Share
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

avatar image Babar Q. · Jul 07, 2020 at 02:22 PM 0
Share

Hello @Matthias H.

Thank you for your kind reply with a workaround solution. Let me go back to the developers especially those who instrumented the mobile application and then I will come back to you for further assistance.

Regards,

Babar

avatar image Zero H. · Nov 23, 2020 at 02:49 AM 0
Share

@Matthias H.

I have a similar scenario where visibility is broken with the Cordova Hybrid Web view deployment. We can see mobile actions entering Dynatrace but we cannot track the underlying mapping to server side requests.

May I ask if your shared script can be applied once (i.e. on a commonly accessed web view page) on a master web view page? Or it needs to be applied every where?


Thank you.

avatar image Matthias H. Zero H. · Nov 23, 2020 at 09:03 AM 0
Share

It basically needs to be applied where you execute your network call. If you have not a single point which is executing the call, you need to apply it for every call. If you need more help open a support case so we can analyze the situation.

avatar image

Answer by Thomas B. · Jul 06, 2020 at 03:47 PM

Hi Babar!

for 1:

What kind of library are you using for the web requests? If they originate from a User Action in the web part and go through a library (or your own implementation) to the native part of the app, then they can not be correlated. Which libraries are you using?

for 2:

When setting up the Cordova mobile app through the Dynatrace instrumentation wizard, a web application is created. If the UI of your app is mainly written in web technologies, then all the User Actions will be sent to this web application. Please note that User Actions in the web application will only be created if they can be correlated with a web request.

–Thomas

Comment
Maciej N.
Babar Q.

People who like this

2 Show 3 · Share
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

avatar image Babar Q. · Jul 07, 2020 at 02:23 PM 0
Share

Hello @Thomas B.

Thank you for your kind reply. Let me go back to the developers to grab this information and then I will come back to you for further assistance.

Regards,

Babar

avatar image Babar Q. · Jul 08, 2020 at 10:16 AM 0
Share

Hello @Thomas B.

I got the below answer.

The HTTP requests are managed by the IBM Mobile First Plugin:

Regards,

Babar

avatar image Thomas B. ♦ Babar Q. · Jul 14, 2020 at 05:37 AM 1
Share

Hey Babar! Thanks for the info. Does the snippet, that Matthias provided, solve the problem? If not, could you then please open a support request so this can be handled properly?

How to get started

First steps in the forum
Read Community User Guide
Best practices of using forum

NAM 2019 SP5 is available


Check the RHEL support added in the latest NAM service pack.

Learn more

LIVE WEBINAR

"Performance Clinic - Monitoring as a Self Service with Dynatrace"


JANUARY 15, 3:00 PM GMT / 10:00 AM ET

Register here

Follow this Question

Answers Answers and Comments

31 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Define conversion goal only on page name and not whole url

Hi Team, Need to check can we get session i'd and session details from OneAgent Dynatrace as we get from Appmon Dynatrace While monitoring through web server sensor or capturing the method value returning the same.

Dynatrace component to monitor around 20 hosts ?

About data collection specification of User actions

Content-type variation on User session export.

Forum Tags

mobile monitoring dotnet iis chat kubernetes servicenow amazon web services feedback mysql mainframe application rules rest api cassandra dashboard oneagent sdk cmc application monitoring openkit smartscape request attributes monitoring developer community user tagging log monitoring services ufo activegate auto-detection high five award webserver uem usql iib test automation license ios news migration management zones ibm mq web services notifications sso host monitoring knowledge sharing reports browser monitors java hybris sap vmware maintenance window user action naming javascript appmon ai availability tipstricks automation extensions diagnostic tools session replay permissions search davis assistant auto-update faq documentation problem detection http monitors easytravel apdex network docker tags and metadata cloud foundry google cloud platform synthetic monitoring process groups account usability dynatrace saas gui paas openshift key user actions administration production user actions postgresql synthetic locations upgrade oneagent security Dynatrace Managed user management python technologies mongodb openstack user session monitoring continuous delivery citrix configuration alerting performance monitoring NGINX action naming linux nam installation error reporting database mission control apache mobileapp RUM php azure purepath davis scripting aix nodejs android
  • Forums
  • Public Forums
    • Community Connect
    • Dynatrace
      • Dynatrace Open Q&A
    • Application Monitoring & UEM
      • AppMon & UEM Open Q&A
    • Network Application Monitoring
      • NAM Open Q&A