We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

Measuring Experience Execution Timing

The tp object is initialized by the tinypass.min.js JavaScript library.

You could measure the time when the tp object is initialized by capturing the timestamp right after initializing the tp object, for example like this:

tp = window.tp || [];
const tpInitTime = Date.now();

tp.push(["init", function() {
    console.log("Piano tp object initialized at: " + tpInitTime);
    // Additional initialization code here
}]);

There isn't a specific "ready" event for the tp object itself.

The experienceExecute event fires when an Experience is executed for a user pageview. You can capture the timestamp when this event fires to measure the execution time, in a similar fashion to the above for example like this:

tp.push(["addHandler", "experienceExecute", function(e) { 
    const experienceExecuteTime = Date.now(); 
    console.log("Experience executed at: " + experienceExecuteTime); 
    // Additional code to handle experience execution 
}]);

Last updated: