var timeSpent = 0; setInterval(function() { timeSpent += 1; fbq('trackCustom', 'TimeSpent', { time: timeSpent }); }, 1000);