Skip to content

Instantly share code, notes, and snippets.

BrandesEric

Block or report user

Report or block BrandesEric

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<html>
<head>
<script src="/dist/bundle.js">
</script>
</head>
</html>
@BrandesEric
BrandesEric / awesome.js
Last active Jun 19, 2018
TrackJS onError sending to third party API first, before tracking
View awesome.js
let filename = ''
let jsonURL = 'https://api.myjson.com/bins'
let token = 'YOUR_TOKEN_HERE'
let trackJsCaptureUrl = `https://capture.trackjs.com/capture?token=${token}`
let actions = []
export function configureTracker () {
window.trackJs.configure({
onError: (payload, error) => {
@BrandesEric
BrandesEric / index-simple.js
Last active May 23, 2016
Webpack and TrackJS
View index-simple.js
// The easiest way to use TrackJS with webpack
// You can put the initial config in a different file if you wish, just make sure it's loaded before you require('trackjs')
window._trackJs = {
token: ""
}
require('trackjs'); // window.trackJs() will be a thing now in the browser.
// You can just treat as global if you wish:
trackJs.track("Test error");
View Test.html
<html>
<head>
<title>Error: It&#39;s just a flesh wound</title>
<meta name="author" content="TrackJS">
<meta name="description" content="Error: It&#39;s just a flesh wound" />
<meta property="og:description" content="http://localhost:3000/js/tracker-backup.js 41:116" />
<meta property="og:site_name" content="TrackJS" />
<meta property="og:title" content="Error: It&#39;s just a flesh wound" />
<meta property="og:url" content="https://local.trackjs.com:443/shared/MDczNzRkMmIwMTBjNDcyNzhmMWE2ZmY1OTA5ODMwMmM" />
<meta property="og:image" content="http://s3.amazonaws.com/uploads.hipchat.com/62739/433807/JoiUFgD4qldaTtK/favicon-196x196.png" />
View track.js
// This thing lives at /client/lib/compatibility
(function (){
window._trackJs = {
token: "mytoken"
};
// the entire tracker script here
})()
You can’t perform that action at this time.