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

This product reached the end of support date on March 31, 2021.

javascript ADK string value in Business Transaction Splitting not working in 6.2.4.1057?

sjoerd1
Advisor

Hi,

Using the Javascript ADK, we inserted a piece of code, that we see nicely coming back in the Actions overview.

So far, so good.

Now when I try to create a Splitting measure on this "Javascript ADK String Value", I get nothing... (not even when leaving all blank, to just get everything).

What am I doing wrong?

Code snippet:

if(typeof window.dT_!='undefined'){
var dT_Clientstring='[CallbackName='+callbackName+'][Status='+statusCode+']';
dynaTrace.reportString('Callback Event',dT_Clientstring);
}

8 REPLIES 8

florent_duchate
Dynatrace Pro
Dynatrace Pro

Hi

I'd say the JavaScript looks ok but it is worth checking for any JavaScript errors in your browser first.

Is the value showing on the relevant user action?

See example for easyTravel below:

Regards

Flo

sjoerd1
Advisor

I'm getting the result as a top level page action, because it is triggered by an asynchronous event from an applet.

florent_duchate
Dynatrace Pro
Dynatrace Pro

Hi

I wonder if that's the problem because typically the reportString is below a parent action.

On a different note, could you try not to use [ ] in the actual value field?

It is probably not the case but I wonder if it is upsetting the BT as they are specific characters used to the tag purepaths...

Could you attach a screenshot of your BT too?

Regards

Flo

sjoerd1
Advisor

At first I created a regexp to remove the [] for the BT, I just want the values of both fields, but since this didn't work I simplified things....

Also varying with the Threshold to 1 didn't help.

sjoerd1
Advisor

Hi Flo,


Should I try to rewrite the handler to the below, or will this just add (network) overhead?:

if(typeof window.dT_!='undefined'){
var dTAction=dynaTrace.enterAction("Callback", "Asynchandler", , false);
var dT_Clientstring='[CallbackName='+callbackName+'][Status='+statusCode+']';
dynaTrace.reportString('Callback Event',dT_Clientstring);
dynaTrace.leaveAction(dTAction,,);
}

florent_duchate
Dynatrace Pro
Dynatrace Pro

Hi

I don't think it will add any overhead by explicitly specifying the action.

sjoerd1
Advisor

Hi Flo,

Might be the cause indeed...

Just created a small test application, with only this code:

        <script type="text/javascript">
if (typeof window.dT_ != 'undefined'){
dynaTrace.setAppVersion("16.02");
var dTAction = dynaTrace.enterAction("Callback", "Asynchandler", null , false);
var dT_Clientstring = '[CallbackName=Pipo][Status=100]';
dynaTrace.reportString('Callback Event', dT_Clientstring);
dynaTrace.leaveAction(dTAction, null, null);
}
</script>

Now I do see my BT capturing data... So I will remove the enteraction and try again...

sjoerd1
Advisor

Hi Flo,

Just see that I can't test it like this, because the page is always loaded to trigger the script to be executed, hence the reportString is always put as child below the pageloader.

So I will just put this live and see what happens....

Thank you VERY much for your prompt support!

Sjoerd