Last active
December 8, 2016 14:59
-
-
Save bradleypriest/e6b527b14fd50fc68863ee6ec9fed280 to your computer and use it in GitHub Desktop.
Sentry - Expand Mixpanel events
This file contains 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 mixpanelHandler = function(event) { | |
var strong = $(event.target).siblings('strong')[0]; | |
if (strong.innerText.trim() === 'GET') { | |
var data = atob(unescape(event.target.href.match(/\?data\=(.+)\&ip/)[1])) | |
event.target.setAttribute('title', data); | |
strong.innerText = `MIXPANEL - ${JSON.parse(data).event} `; | |
} | |
} | |
$(document).on('mouseover', 'a[href*=mixpanel]', mixpanelHandler); | |
var requestIdHandler = function(event) { | |
var $anchor = $(event.target); | |
var time = $('.seen-info').eq(0).find('time').eq(0).attr('datetime'); | |
$anchor.attr('href', `https://papertrailapp.com/systems/tradegecko/events?q=${$anchor.text()}&ut=${time}`); | |
$anchor.attr('target', '_blank'); | |
} | |
$(document).on('mouseover', 'a[href*=requestId]', requestIdHandler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment