Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion riveted.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var riveted = (function() {
sendUserTiming,
reportInterval,
idleTimeout,
maxTime,
nonInteraction,
universalGA,
classicGA,
Expand All @@ -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';

/*
Expand Down Expand Up @@ -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);
}

Expand Down
5 changes: 3 additions & 2 deletions test/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
riveted.init({
reportInterval: 2,
idleTimeout: 5,
maxTime: 1e3,
nonInteraction: false,
//gaGlobal: '__gaTracker',
gaTracker: 'fooo'

/*eventHandler: function(event) {
console.log(event);
},
Expand All @@ -50,4 +51,4 @@
<body>
<h1>Test</h1>
</body>
</html>
</html>