Skip to content

Instantly share code, notes, and snippets.

@bmarshall511
Created August 20, 2014 16:53
Show Gist options
  • Save bmarshall511/8abae39f5d0b3eb191b2 to your computer and use it in GitHub Desktop.
Save bmarshall511/8abae39f5d0b3eb191b2 to your computer and use it in GitHub Desktop.
<div class="points"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="jquery.interactionPoints.js"></script>
<script>
$(function() {
// Initialize the User Interaction Points jQuery Plugin
$('.points').interactionPoints({
url: 'your-script-here.php', // The URL the points get posted to, required
container: window, // The element to track interactions on
value: 1, // The amount of points each second is worth
post: 30, // Number of seconds to post points to script
data: { 'userID': 1 }, // Additional data you want passed to the php script (ie. userID)
debug: 1, // Enables/diables debugging
action_limit: 300 // Number of seconds until the user is timeout after their last key press
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment