Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
HTML5 Crittercism Code Snippets for Docs
// Save event handler with breadcrumb
$('#saveButton').click(function() {
Crittercism.leaveBreadcrumb("Save button clicked");
<!DOCTYPE html>
<title>Example Document without Crittercism</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(document).ready(function() {
appId: 'appId', // Example: 47cc67093475061e3d95369d
appVersion: '1.0', // Developer-provided application version
// Initialize event handlers here
<p>This document uses the Crittercism HTML5 library.</p>
Crittercism.setUsername("TomCritter").setValue('savedItems', 100);
try {
JSON.parse('this isnt valid json');
} catch(e) {
// How long did the game take to load?
var gameLoadTime = getGameLoadTime();
storedSprites: getStoredSprites(),
gameLoadTime: gameLoadTime,
virtualCurrencyBalance: 100
var gameLoadTime = getGameLoadTime();
Crittercism.setValue('gameLoadTime', gameLoadTime);
// Example login flow
var authenticatedUser = authenticateUser();
// Assume username is stored in authenticatedUser.username
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.