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

tracking virtual pages - work with VPageView

jakub.vagner2
Builder

Hi,
I'd like to clarify expected use cases, how we should work with VPageView tracker object for transition between 2 virtual pages:


according to the example down here, the use case could be:

 

  1. instantiate object: 
    var tracker = ADRUM.events.VPageView({url:"some url"});
  2. start tracking (marks the starting time) .. latest version of code calls this from the constructor, so this might be optional?

    tracker.start();
  3. do the transition, page content loading etc .. use mark* setters for different phases if we need more granularity
  4. end the tracking by
    tracker.end();
  5. send the result into AD:
    ADRUM.report(tracker);


do I have to finish the whole scenario? for example what happens, if I call only start() and then send it to AD? and then later create new tracker (for the same url), call end() on it and send it again? which setters on the tracker object are 'necessary'? do I have to pass URL in the constructor (as it's in the example), or not (as it's in the middle of the page)?

are the Error tracker objects also 'xhr correlated'? if so, where is this relation stored? for example if user is working in multiple tabs ..

thanks for clarifying this, I haven't seen the answers in the documentation ..
J.

 

4 REPLIES 4

jakub.vagner2
Builder

and here's another example of UC, which might be quite common and we would like to track it .. when user navigates to some page and while the page is loading, he will navigate away again ..

 

something like this?

 

var tracker = ADRUM.events.VPageView({url:"some url"})
tracker.start();
ADRUM.report(tracker);

 

br

J.

Mayuresh.Kshirsagar
AppDynamics Team (Retired)

Hi Jakub,

 

If you don't explicitly set the end() marker, it will still go ahead and send the metrics without the Page Load Time (PLT metric), however the EUM server will reject the report as this is a mandatory metric. You should see something like this in the DroppedBeacons.log:

31 Mar 2017 02:28:01.263 -0700  Beacon to Record Converter-7  DroppedBeacon              INFO    appKey=EUM-AAB-BEY, recordType=BROWSER, validationType=INSUFFICIENT_DATA_METRIC, agentVersion=null, message=VIRTUAL_PAGE, Mandatory metric [PLT] not available : {"eg":"2","et":3,"eu":"5/6#7","ts":1490952479169,"mg":"0","au":"1://2/3/4","at":0,"ud":{"d1":"v1","d2":"v2","d3":"v3"},"mx":{"DDT":80,"DRT":421,"DPT":341,"DOM":421,"PLC":1},"si":227}

When you create a new tracker, it will be a different session being reported, hence it wont build on the old in-complete session.

 

The mandatory metrics for Virtual Pages is the Page Load Time (PLT) which is marked by the end() call. Another mandatory metric Page Load Count (PLC) is calculated automatically and is included in the metrics automatically.

 

I am not sure I understood the question about Error trackers being xhr correlated. The Error tracker is to report error for the base page if  the parent object is not set. If the parent is set to a particular object tracker (ajax, virtual page, etc) it will be reported for that object.

 

eg If you report something like:

		var ajaxT = new ADRUM.events.Ajax();
		   
		// set url
		ajaxT.url('something loaded');
		   
		// mark timings
		ajaxT.markSendTime(100);
		ajaxT.markFirstByteTime(200);
		ajaxT.markRespAvailTime(300);
		ajaxT.markRespProcTime(400);
		
		var errorm = new ADRUM.events.Error();
		errorm.msg("test message123");
		errorm.line(10);
		errorm.parent(ajaxT);
		ADRUM.report(errorm);

You would see the error in the browser snpshot as:

Screen Shot 2017-03-31 at 3.11.16 AM.png

 

Let me know if this answers your question.

Hi!

 that makes sense, thanks, I'll try it .. and it might be answer for this question too

 

one more thing, we have disabled tracking of base pages (we have single page application in React), what should I set into the parent then? VirtualPage? even if this object might have been 'ended and reported' already? or should I do something like this? but it will probably create new vPage hit, right?

function report(msg) {
 const vPageView = new ADRUM.events.VPageView({url: url});
 vPageView.start();

 var errorm = new ADRUM.events.Error();
 errorm.msg(msg);
 errorm.parent(vPageView);
 ADRUM.report(errorm);

 vPageView.end();
 ADRUM.report(vPageView);
}

let's continue in the other topic/question for the case of errors :)

 

https://community.appdynamics.com/t5/EUM-and-Analytics-Mobile-Metrics/manual-tracking-of-errors/m-p/...