mirror of
https://github.com/moonlight-stream/moonlight-stream.github.io.git
synced 2026-02-16 10:31:12 +00:00
Add external link tracking
This commit is contained in:
@@ -247,6 +247,11 @@
|
||||
ga('create', 'UA-47339221-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
!function(t){"use strict";var e=window.location.host;t("body").on("click",function(n){
|
||||
function o(){document.location=a}if(!n.isDefaultPrevented()&&"function"==typeof ga){
|
||||
var i=t(n.target).closest("a");if(1==i.length&&e!=i[0].host){n.preventDefault();
|
||||
var a=i[0].href;ga("send",{hitType:"event",eventCategory:"outbound",eventAction:"link",
|
||||
eventLabel:a,hitCallback:o}),setTimeout(o,1e3)}}})}(jQuery);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user