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

RUM Javascript API

WeilinT
Observer

Hi, 

I would like to find out if the mode of data collection when using RUM JavaScript API is the same as inserting a JavaScript Tag snippet into the HTML page? Do data from into Dynatrace the same way or is this another route?

The reason for using RUM JavaScript API is because i have user interaction that does not trigger a web request and is not registered by Dynatrace as a user action, hence i would like to use the Custom Action. For Custom Action would the web user action masking capability be applicable as well?

Thanks.

4 REPLIES 4

Fin_Ubels
Dynatrace Champion
Dynatrace Champion

Hey Weilin,

The RUM JavaScript API requires the snippet to exist to be used so the data is ingested the same way. If you have the snippet then if you use the API to add additional actions or data then you'll just be enriching new user sessions with more data.

Regarding masking, yes masking still applies to custom actions but you also supply information like the action name so if you don't want data to show up don't provide it.

Hope this helps!

Hi Fin_Ubels, 

Thanks for you reply, this is really useful. But i just want to understand a little more:

1. Understand that the javascript snippet is still required, but how does this API works? Does it store these action data as a variable and pass them to Dynatrace using the javascript snippet?

2. Custom user action, from the documentation (and also appended below), actionName is not an optional field, but i will still be able to leave it as empty? How will it show up in the Dynatrace portal? like "Click on <DIV> on page /home"? 

would love to test this out myself, but unfortunately my trial account has expired. 

Thanks for your help so far and look forward to hearing back from you. 

 

  • enterAction(actionName: string, actionType?: string, startTime?: number, sourceUrl?: string): number
  • Enters a new custom action. Use to set the load start event for a new custom action. Needs to be called before leaveAction, which closes the custom action.

    see

    leaveAction

    Parameters

    • actionName: string

      Name of the action

    • Optional actionType: string

      DEPRECATED: not used any more and has no effect if provided

    • Optional startTime: number

      Timestamp in milliseconds. if null, current time is used.

    • Optional sourceUrl: string

      Source url for the action

Fin_Ubels
Dynatrace Champion
Dynatrace Champion

Hey Weilin

1. The API is provided by the snippet so you're directly interacting with the snippet to force it to report back what you want it to (if I understand it correctly). If you want to test it you can add the snippet to a test site and then open the developer console (f12 console) and type dtrum.someAPIMethod(etc etc). Then once you're satisfied with the result you can bake it into your application.

2. I wasn't suggesting that you leave it empty but you can provide any value, so it doesn't have to contain sensitive data, it can contain whatever you want it to contain such as "Blank" or "NondescriptActionName". Also, you can modify action name layouts using placeholders and plain text to customize them even further. 

Fin_Ubels_0-1689733180243.png

 

Thanks for your clarification!

Featured Posts