Highlighted

Calculate page load time and pass it into our analytic tool? I know GA offers this out of the box but we cannot use GA. In doing some light research it appears GA calculates this based off the following documentation posted on the W3C site.

Silver Contributor
Silver Contributor
http://w3c-test.org/webperf/specs/NavigationTiming/. Has any tried to set this up directly via Tealium?
8 REPLIES 8
Highlighted

Calculate page load time and pass it into our analytic tool? I know GA offers this out of the box but we cannot use GA. In doing some light research it appears GA calculates this based off the following documentation posted on the W3C site.

Tealium Employee
Joe, you're reading our minds. I just an an email to the team (today) and we have a volunteer to code this up. We'll put together a javascript extension that will collect this info and allow you to map to your analytics tool.
Highlighted

Calculate page load time and pass it into our analytic tool? I know GA offers this out of the box but we cannot use GA. In doing some light research it appears GA calculates this based off the following documentation posted on the W3C site.

Silver Contributor
Silver Contributor
Awesome. Thank you.
Highlighted

Calculate page load time and pass it into our analytic tool? I know GA offers this out of the box but we cannot use GA. In doing some light research it appears GA calculates this based off the following documentation posted on the W3C site.

Silver Contributor
Silver Contributor
The extension code provided is throwing an error in IE8 on us now. 'performance' is undefined. Which is odd because it looks like we are checking first if(performance&&performance.timing){t=performance.timing;
Highlighted

Calculate page load time and pass it into our analytic tool? I know GA offers this out of the box but we cannot use GA. In doing some light research it appears GA calculates this based off the following documentation posted on the W3C site.

Tealium Employee
I think you'll have to use something like: if(typeof performance!="undefined" &&performance.timing){t=performance.timing;
Highlighted

Calculate page load time and pass it into our analytic tool? I know GA offers this out of the box but we cannot use GA. In doing some light research it appears GA calculates this based off the following documentation posted on the W3C site.

Bronze Contributor
Bronze Contributor
Can you give me complete code to put in javascript extension to get data for pageload time.
Highlighted

Calculate page load time and pass it into our analytic tool? I know GA offers this out of the box but we cannot use GA. In doing some light research it appears GA calculates this based off the following documentation posted on the W3C site.

Tealium Employee

Hi @jariwalayash

var loadTime;

if (window.performance && window.performance.timing) {
  loadTime = window.performance.timing.domContentLoadedEventEnd- window.performance.timing.navigationStart;
}

 

A full listing of properties can be found here https://developer.mozilla.org/en-US/docs/Web/API/Performance

A short list that you might like:

Property Definition
connectEnd Time when server connection is finished.
connectStart Time just before server connection begins.
domComplete Time just before document readiness completes.
domContentLoadedEventEnd Time after DOMContentLoaded event completes.
domContentLoadedEventStart Time just before DOMContentLoaded starts.
domInteractive Time just before readiness set to interactive.
domLoading Time just before readiness set to loading.
domainLookupEnd Time after domain name lookup.
domainLookupStart Time just before domain name lookup.
fetchStart Time when the resource starts being fetched.
loadEventEnd Time when the load event is complete.
loadEventStart Time just before the load event is fired.
navigationStart Time after the previous document begins unload.
redirectCount Number of redirects since the last non-redirect.
redirectEnd Time after last redirect response ends.
redirectStart Time of fetch that initiated a redirect.
requestStart Time just before a server request.
responseEnd Time after the end of a response or connection.
responseStart Time just before the start of a response.
timing Reference to a performance timing object.
navigation Reference to performance navigation object.
performance Reference to performance object for a window.
type Type of the last non-redirect navigation event.
unloadEventEnd Time after the previous document is unloaded.
unloadEventStart Time just before the unload event is fired.

 

Adrian

Ask me anything Tealium related or Javascript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.
Highlighted

Calculate page load time and pass it into our analytic tool? I know GA offers this out of the box but we cannot use GA. In doing some light research it appears GA calculates this based off the following documentation posted on the W3C site.

Silver Contributor
Silver Contributor

Hey @adrian_browning

If I add this code as a JS extension, I cannot map it to a certain prop (we are using Adobe and replace DTM by Tealium) as it is not possible to map extensions to evars & props. 

How would I need to do this? Add this variable as a UDO? 

Best,

Pascal

Highlighted

Calculate page load time and pass it into our analytic tool? I know GA offers this out of the box but we cannot use GA. In doing some light research it appears GA calculates this based off the following documentation posted on the W3C site.

Tealium Employee

Hi @pascalreder

The best way to do it would be to 

  1. Create a Data Layer item
  2. Map that to the eVar/prop
  3. In an extension set this to be the output of one of the data point.

Adrian

Ask me anything Tealium related or Javascript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.