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

capture orderID using CSS sector.

amitbsht321
Contributor
Hi Team,
 
We have a requirement to capture custom attribute "order request ID". So to capture that we have used session and action property.
Under session and action property, we are using CSS selector, as expression type and Data type as an  double. Below is the CSS selector for the same.
#mat-dialog-7 > app-order-placed-modal > mat-dialog-content > div > div > div > span
 
unfortunately it's not working. unable to capture desired output.
 
Can someone help us on the same. Thanks in advance.
 
Regards,
Amit Singh Bisht 
 
1 REPLY 1

simon_schatka
Dynatrace Helper
Dynatrace Helper

Hi

 

Without knowing how your page looks, it is impossible to give you an exact answer, so here are the things you can try:
We are using document.querySelector("#mat-dialog-7 > app-order-placed-modal > mat-dialog-content > div > div > div > span") to find the value you want to capture. You can enter that in the console of the developer tools of your browser to see if that is actually an item that can be found on the page.

Your selector is highly depending on the structure of the html, so it might just change randomly and therefore can not be found. It is always best to have an id on the element to capture, to be 100% that it can be captured.

Additionally check that the page this element is on, is actually running the javascript agent. If this element is in a frame or an iframe, we will not be able to capture this element, unless the javascript agent is available. Having it available on a top frame is not enough.

Also check this: Is this value available all the time or is it only available at random points in time? We are capturing the data whenever an action FINISHES, so if you have values that change or only get shown intermediately, it can be a problem as well.

And as a last thing: run "dtrum.getAndEvaluateMetaData()". It will returns an object showing you the currently available metadata we can capture for this page and might also show why the value is missing.

 

Simon

Featured Posts