-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
77 lines (75 loc) · 2.29 KB
/
test.html
File metadata and controls
77 lines (75 loc) · 2.29 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script>
!(function () {
var e = [
'identify',
'page',
'track',
'startAutoIdentify',
'stopAutoIdentify',
'startAutoPage',
'stopAutoPage',
'startAutoTrack',
'stopAutoTrack',
];
function t(o) {
return Object.assign(
[],
e.reduce(function (r, n) {
return (
(r[n] = function () {
return o.push([n, [].slice.call(arguments)]), o;
}),
r
);
}, {}),
);
}
window.unify || (window.unify = t(window.unify)),
window.unifyBrowser || (window.unifyBrowser = t(window.unifyBrowser));
var n = document.createElement('script');
(n.async = !0),
n.setAttribute('src', 'dist/js/browser/index.min.js'),
n.setAttribute(
'data-api-key',
'wk_5fTtsDLJ_7vx9DsjPcr79yk4FweES727w59pxS8EJ',
),
n.setAttribute('id', 'unifytag'),
(document.body || document.head).appendChild(n);
})();
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root">
<div style="display: flex; align-items: center; gap: 16px">
<!-- Legacy track data attrs -->
<button data-unify-track-clicks>Legacy track</button>
<button data-unify-track-clicks data-unify-attr-custom="test">
Legacy track custom attrs
</button>
<button data-unify-track-clicks data-unify-label="Custom Button Name">
Legacy track custom label
</button>
<!-- Current track data attrs -->
<button data-unify-click-event-name="Test Button Clicked">Track</button>
<button
data-unify-click-event-name="Test Button Clicked"
data-unify-event-prop-custom="test"
>
Track custom attrs
</button>
<button
data-unify-click-event-name="Test Button Clicked"
data-unify-label="Custom Button Name"
>
Track custom label
</button>
<button>Should not track</button>
</div>
</div>
</body>
</html>