-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·54 lines (49 loc) · 1.56 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Demo</title>
<!-- add the tracking script and call it -->
<script type="text/javascript" src="pirsch.js" id="pirschjs"
data-endpoint="/count"
data-domain="http://13.51.170.117/"
data-client-id="42"
data-include="\/.*(\.html)?"
data-dev
data-param-optional-param="test"></script>
<!-- add the event script -->
<script type="text/javascript" src="pirsch-events.js" id="pirscheventsjs"
data-endpoint="/event"
data-client-id="42"
data-dev></script>
</head>
<body>
<h1>Home</h1>
<p>
<a href="/index.html">Home</a>
<a href="/page1.html">Page 1</a>
<a href="/page2.html" id="eventlink">Page 2</a>
</p>
<p>
<button id="eventbutton">Event</button>
</p>
<!-- track an event on link click -->
<script type="text/javascript">
document.getElementById("eventlink").addEventListener("click", () => {
pirsch("link clicked", {meta: {key: "value"}});
});
</script>
<!-- track an event on button click -->
<script type="text/javascript">
document.getElementById("eventbutton").addEventListener("click", () => {
pirsch("button clicked", {meta: {key: "value"}});
});
</script>
<!-- uncomment to test tracking history changes -->
<!--<script type="text/javascript">
setTimeout(function() {
history.pushState({}, "", "/page");
}, 2000);
</script>-->
</body>
</html>