forked from magento/devdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalytics.js
56 lines (48 loc) · 1.23 KB
/
analytics.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
Track onbound links click (for GitHub links)
*/
$('.improve-page').on('click', function (e) {
e.preventDefault();
var $this = $(this),
url = $this.attr('href');
ga('send', 'event', {
eventCategory: 'Outbound Link',
eventAction: 'click',
eventLabel: 'Edit this page on GitHub',
//eventValue: 1,
transport: 'beacon',
hitCallback: function(){document.location = url;}
});
})
/**
Track "Give us Feedback" link click
*/
$('.new-issue a').on('click', function (e) {
e.preventDefault();
var $this = $(this),
url = $this.attr('href');
ga('send', 'event', {
eventCategory: 'Outbound Link',
eventAction: 'click',
eventLabel: 'Give us feedback',
//eventValue: 1,
transport: 'beacon',
hitCallback: function(){document.location = url;}
});
});
/**
Track "Become Contributor" home page button
*/
$('.home-contributors .btn-primary').on('click', function (e) {
e.preventDefault();
var $this = $(this),
url = $this.attr('href');
ga('send', 'event', {
eventCategory: 'Internal Link',
eventAction: 'click',
eventLabel: 'Become Contributor on home page',
//eventValue: 1,
transport: 'beacon',
hitCallback: function(){document.location = url;}
});
});