Fix bug that caused outbound links to stop working with some ad blockers

This commit is contained in:
Thomas Jensen 2019-04-03 21:56:10 +02:00
parent f1d9ac6143
commit 76050ee56a
No known key found for this signature in database
GPG Key ID: 54243EF8EA4945B2
1 changed files with 8 additions and 4 deletions

View File

@ -9,9 +9,13 @@
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script>
var trackOutboundLink = function(targetName, targetUrl) {
ga('send', 'event', 'outbound', 'click', targetName, {
'transport': 'beacon',
'hitCallback': function(){document.location = targetUrl;}
});
if (ga.loaded) {
ga('send', 'event', 'outbound', 'click', targetName, {
'transport': 'beacon',
'hitCallback': function(){ document.location = targetUrl; }
});
} else {
document.location = targetUrl;
}
}
</script>{% endif %}