Skip to content

Instantly share code, notes, and snippets.

@bradleypriest
Last active December 8, 2016 14:59
Show Gist options
  • Save bradleypriest/e6b527b14fd50fc68863ee6ec9fed280 to your computer and use it in GitHub Desktop.
Save bradleypriest/e6b527b14fd50fc68863ee6ec9fed280 to your computer and use it in GitHub Desktop.
Sentry - Expand Mixpanel events
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