Analytics for link tracking.
Does it work?
This commit is contained in:
+10
-1
@@ -15,8 +15,17 @@ type='text/css'>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments)};
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'UA-33267683-1');
|
||||
|
||||
var trackLink = function(label,url) {
|
||||
gtag('event', 'click', {
|
||||
'event_category': 'link',
|
||||
'event_label': label,
|
||||
'event_action': url,
|
||||
'transport_type': 'beacon',
|
||||
'event_callback': function(){document.location = url;}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user