diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..10d75a4 Binary files /dev/null and b/.DS_Store differ diff --git a/riveted.js b/riveted.js index 6398507..78e5edc 100644 --- a/riveted.js +++ b/riveted.js @@ -35,6 +35,7 @@ var riveted = (function() { sendUserTiming, reportInterval, idleTimeout, + maxTime, nonInteraction, universalGA, classicGA, @@ -48,6 +49,7 @@ var riveted = (function() { options = options || {}; reportInterval = parseInt(options.reportInterval, 10) || 5; idleTimeout = parseInt(options.idleTimeout, 10) || 30; + maxTime = parseInt(options.maxTime, 10) || 1e10; gaGlobal = options.gaGlobal || 'ga'; /* @@ -211,7 +213,7 @@ var riveted = (function() { function clock() { clockTime += 1; - if (clockTime > 0 && (clockTime % reportInterval === 0)) { + if (clockTime > 0 && clockTime < maxTime && (clockTime % reportInterval === 0)) { sendEvent(clockTime); } diff --git a/test/test.html b/test/test.html index 6f8fc43..f958007 100644 --- a/test/test.html +++ b/test/test.html @@ -33,10 +33,11 @@ riveted.init({ reportInterval: 2, idleTimeout: 5, + maxTime: 1e3, nonInteraction: false, //gaGlobal: '__gaTracker', gaTracker: 'fooo' - + /*eventHandler: function(event) { console.log(event); }, @@ -50,4 +51,4 @@

Test

- \ No newline at end of file +