-
-
Save hano/5697135 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Example Document without Crittercism</title> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript" src="https://d1a62freaxhn7x.cloudfront.net/v1/crittercismClientLibraryMin.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
Crittercism.init({ | |
appId: 'appId', // Example: 47cc67093475061e3d95369d | |
appVersion: '1.0' // Developer-provided application version | |
}); | |
// Initialize event handlers here | |
}); | |
</script> | |
</head> | |
<body> | |
<p>This document uses the Crittercism HTML5 library.</p> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Crittercism.setUsername("TomCritter").setValue('savedItems', 100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
JSON.parse('this isnt valid json'); | |
} catch(e) { | |
Crittercism.logHandledException(e); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How long did the game take to load? | |
var gameLoadTime = getGameLoadTime(); | |
Crittercism.setMetadata({ | |
storedSprites: getStoredSprites(), | |
gameLoadTime: gameLoadTime, | |
virtualCurrencyBalance: 100 | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gameLoadTime = getGameLoadTime(); | |
Crittercism.setValue('gameLoadTime', gameLoadTime); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example login flow | |
var authenticatedUser = authenticateUser(); | |
// Assume username is stored in authenticatedUser.username | |
Crittercism.setUsername(authenticatedUser.username); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment