-
Notifications
You must be signed in to change notification settings - Fork 3
/
consentmanager.html
110 lines (98 loc) · 4.61 KB
/
consentmanager.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
<!DOCTYPE html>
<html>
<head>
<title>Home Questionnaire<span id="selection-marker-1" class="redactor-selection-marker"></span></title>
<!-- SEGMENT-->
<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","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){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=e};analytics._writeKey="30t6DSp4jMg8gMmr20XP3EEuuXzPKtS4";;analytics.SNIPPET_VERSION="4.15.3";
//Remove analytics.load call from your code snippet
//analytics.load("30t6DSp4jMg8gMmr20XP3EEuuXzPKtS4");
analytics.page();
}}();
</script>
<!-- SEGMENT-->
<div id="target-container"></div>
</head>
<body>
<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"/>
</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.track('destination submitted', user, function() {
window.location.href = "";
});
}
</script>
<script>
window.consentManagerConfig = function(exports) {
var React = exports.React
var inEU = exports.inEU
var bannerContent = React.createElement(
'span',
null,
'We use cookies (and other similar technologies) to collect data to improve your experience on our site. By using our website, you՚re agreeing to the collection of data as described in our',
' ',
React.createElement(
'a',
{ href: '/docs/legal/website-data-collection-policy/', target: '_blank' },
'Website Data Collection Policy'
),
'.'
)
var bannerSubContent = 'You can change your preferences at any time.'
var preferencesDialogTitle = 'Website Data Collection Preferences'
var preferencesDialogContent =
'We use data collected by cookies and JavaScript libraries to improve your browsing experience, analyze site traffic, deliver personalized advertisements, and increase the overall performance of our site.'
var cancelDialogTitle = 'Are you sure you want to cancel?'
var cancelDialogContent =
'Your preferences have not been saved. By continuing to use our website, you՚re agreeing to our Website Data Collection Policy.'
return {
container: '#target-container',
writeKey: '30t6DSp4jMg8gMmr20XP3EEuuXzPKtS4',
shouldRequireConsent: inEU,
bannerContent: bannerContent,
bannerSubContent: bannerSubContent,
preferencesDialogTitle: preferencesDialogTitle,
preferencesDialogContent: preferencesDialogContent,
cancelDialogTitle: cancelDialogTitle,
cancelDialogContent: cancelDialogContent
}
}
</script>
<script
src="https://unpkg.com/@segment/[email protected]/standalone/consent-manager.js"
defer
></script>
</body>
</html>