Skip to content

Instantly share code, notes, and snippets.

@mak00s
Last active September 6, 2018 00:54
Show Gist options
  • Save mak00s/333ff4eec07d542f14b35baad7c193fa to your computer and use it in GitHub Desktop.
Save mak00s/333ff4eec07d542f14b35baad7c193fa to your computer and use it in GitHub Desktop.
function() {
return function(model) {
var hitType = model.get('hitType'),
eventLabel = model.get('eventLabel');
try {
toastr.options.progressBar = true;
if (hitType === 'pageview') {
$("<audio></audio>").attr({
'src': 'http://XXXXX/XXX.mp3',
'autoplay': 'autoplay'
}).appendTo("body");
toastr.success('PVを計測した!', 'Google Analytics');
} else {
$("<audio></audio>").attr({
'src': 'http://XXXXX/XXX.mp3',
'autoplay': 'autoplay'
}).appendTo("body");
toastr.info('イベント(' + eventLabel + ')を計測した!', 'Google Analytics');
}
} catch (e) {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment