-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·199 lines (157 loc) · 5.31 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<html>
<head>
<title>LoginTest</title>
<link rel="manifest" href="https://parthdani.github.io/CleverTapWebsiteExample/manifest.json">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript">
var clevertap = {event:[], profile:[], account:[], onUserLogin:[], notifications:[], privacy:[]};
clevertap.spa = true
clevertap.account.push({"id": "TEST-4R6-8Z4-965Z"});
clevertap.privacy.push({optOut: false});
clevertap.privacy.push({useIP: true});
(
function ()
{
var wzrk = document.createElement('script');
wzrk.type = 'text/javascript';
wzrk.async = true;
//wzrk.src = ('https:' == document.location.protocol ? 'https://d2r1yp2w7bby2u.cloudfront.net' : 'http://static.clevertap.com') + '/js/a.js';
wzrk.src = ('https:' == document.location.protocol ? 'https://parthdani.github.io/CleverTapWebsiteExample/clevertap.js':'http://static.clevertap.com/js/a.js');
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wzrk, s);
})();
function profilepush()
{
var name=document.getElementById("name").value;
var email=document.getElementById("email").value;
clevertap.profile.push({
"Site": {
"Name": name, // User's name
"Email": email,
}
});
}
function onuserLogin()
{
clevertap.event.push("Product Viewed");
var name=document.getElementById("name").value;
var email=document.getElementById("email").value;
clevertap.onUserLogin.push
({
"Site":
{
"Name": name,
"Email": email,
}
});
console.log("onuserlogin called");
// clevertap.notifications.push({
// "titleText":'Would you like to receive Push Notifications?',
// "bodyText":'We promise to only send you relevant content and give you updates on your transactions',
// "okButtonText":'Sign me up!',
// "rejectButtonText":'No thanks',
// "okButtonColor":'#f28046',
// });
//alert("Hello! You have Registered Successfully!!");
}
function events()
{
console.log("notification method called");
var event=document.getElementById("event").value;
clevertap.event.push(event);
// alert("Event Pushed Successfully!!");
}
function getCleverTap()
{
var clevertapID = clevertap.getCleverTapID();
console.log(clevertapID);
alert(clevertapID);
}
clevertap.notifications.push({
"titleText":'Would you like to receive Push Notifications?',
"bodyText":'We promise to only send you relevant content and give you updates on your transactions',
"okButtonText":'Sign me up!',
"rejectButtonText":'No thanks',
"okButtonColor":'#f28046',
"askAgainTimeInSeconds":5,
"serviceWorkerPath": "https://parthdani.github.io/CleverTapWebsiteExample/clevertap_sw.js"
});
</script>
<!-- <script>
(
function(w,d,s,l,i)
{
w[l]=w[l]||[];w[l].push(
{
'gtm.start': new Date().getTime(),event:'gtm.js'
}
);
var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
}
)
(window,document,'script','dataLayer','GTM-52Z3GSV');
function profilepush()
{
var name=document.getElementById("name").value;
var email=document.getElementById("email").value;
clevertap.profile.push({
"Site": {
"Name": name, // User's name
"Email": email,
}
});
}
function onuserLogin()
{
var name=document.getElementById("name").value;
var email=document.getElementById("email").value;
clevertap.onUserLogin.push
({
"Site":
{
"Name": name,
"Email": email,
}
});
console.log("onuserlogin called");
clevertap.notifications.push({
"titleText":'Would you like to receive Push Notifications?',
"bodyText":'We promise to only send you relevant content and give you updates on your transactions',
"okButtonText":'Sign me up!',
"rejectButtonText":'No thanks',
"okButtonColor":'#f28046',
});
alert("Hello! You have Registered Successfully!!");
}
function events()
{
console.log("notification method called");
var event=document.getElementById("event").value;
clevertap.event.push(event);
// alert("Event Pushed Successfully!!");
}
</script> -->
</head>
<body>
<noscript>
<!-- <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-52Z3GSV" height="0" width="0" style="display:none;visibility:hidden">
</iframe>-->
</noscript>
<div class="login-page">
<div class="form">
<!-- <form class="register-form"> -->
<h1>ON USER LOGIN</h1>
<input type="text" id="name" placeholder="NAME" name=""/>
<input type="text" id="email" placeholder="EMAIL ID" name=""/>
<button onclick="onuserLogin()">LOGIN</button>
<br><br>
<input type="text" id="event" placeholder="EVENTS" name=""/>
<button onclick="events()">PUSH EVENT</button>
<button onclick="getCleverTap()">Get CleverTap ID</button>
<p class="message">Click here to check :<button onclick ="profilepush()">Profile Push</button>
<a href="mypage2.html">Go to the anchor</a>
<!-- </form> -->
</div>
</div>
</body>
</html>