-
Notifications
You must be signed in to change notification settings - Fork 3
/
ajs.html
127 lines (107 loc) · 5.13 KB
/
ajs.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html>
<head>
<title>Home Questionnaire<span id="selection-marker-1" class="redactor-selection-marker"></span></title>
<!-- SEGMENT SNIPPET-->
<script>
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"];analytics.factory=function(e){return function(){if(window.analytics.initialized)return window.analytics[e].apply(window.analytics,arguments);var i=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(e)>-1){var c=document.querySelector("link[rel='canonical']");i.push({__t:"bpc",c:c&&c.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}i.unshift(e);analytics.push(i);return analytics}};for(var i=0;i<analytics.methods.length;i++){var key=analytics.methods[i];analytics[key]=analytics.factory(key)}analytics.load=function(key,i){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=i};analytics._writeKey="ZsHvh9mEJuIS3Bx9yt4U5DphdWPAjyk0";;analytics.SNIPPET_VERSION="5.2.0";
analytics.load("ZsHvh9mEJuIS3Bx9yt4U5DphdWPAjyk0");
analytics.page();
}}();
</script>
<!-- SEGMENT SNIPPET-->
<script>
analytics.ready(function() {
if (typeof analytics != undefined && Object.hasOwn(analytics,'initialized') && analytics.initialized == true) {
console.error("WORKS")
}})
</script>
<style>
/* CSS using the ID selector for the button */
#my-button {
background-color: blue;
color: white;
padding: 10px;
border: none;
cursor: pointer;
font-size: 16px;
}
</style>
</head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<body>
<!-- HTML button element -->
<button id="my-button">Click Me</button>
<h1>What is your favorite place to travel?</h1>
<p>I am building a directory of the sweetest travel destinations.</p>
<form name="travel" onsubmit="identify(event)">
What is your favorite travel destination?
<input name="destination" required="" size="81" type="text"/>
<br><br><br>
Any recommendations (cool things to do, places to visit or restaurants to eat)?
<br><br>
<textarea cols="81" name="details" required="" rows="10">
</textarea>
<br><br>
Name: <input name="fullname" required="" size="75" type="text"/>
<br><br>
Email: <input name="email" required="" size="75" type="email"/>
<br><br>
<input name="submit" type="submit" value="submit"/>
<input type="hidden" id="custId" name="custId" value="3487">
</form>
<script type="text/javascript">
function identify(e){
e.preventDefault();
var form = e.target;
var email = form["email"].value;
var fullname = form["fullname"].value;
var destination = form["destination"].value;
var details = form["details"].value;
var user = {
email: email,
name: fullname,
destination: destination,
details: details
};
analytics.identify('1234', {
email: email,
name: fullname
});
//analytics.on('identify', function(userid, traits, options) {
//console.log(userid, traits, options)
//});
analytics.track('destination submitted', user, function() {
window.location.href = "";
});
window.analytics.track("Order Completed", {"service_line":"Transcription","order_id":"TC0697246759","placed_on":"2020-12-10T16:12:39.457","total":2.50000,"order_source_type":"Web","label":"EPC","payment_method":"CreditCard"});
analytics.on('track', function(event, properties, options) {
console.log(event, properties, options)
});
analytics.page('2nd Page', user, function() {
window.location.href = "";
});
//analytics.on('page', function(properties, options) {
//console.log(properties, options)
//});
}
</script>
<br>
<button id="myBtn">My Button</button>
<br>
<p>Click the button below to disable the button above.</p>
<br>
<button onclick="myFunction()">Try it</button>
<br>
<script>
function myFunction() {
document.getElementById("myBtn").disabled = true;
}
</script>
<br>
<div class="pv-payment-item-small-text text-right flip"><input type="checkbox" id="pv-savecc-cb" name="set-name" class="pv-switch-input"><label for="pv-savecc-cb" class="pv-switch-label"></label></div>
</script>
<br>
</body>
</html>