-
Notifications
You must be signed in to change notification settings - Fork 0
/
GTMBranchTestingWithoutBranchSDK.html
166 lines (128 loc) · 4.4 KB
/
GTMBranchTestingWithoutBranchSDK.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google Tag Manager -->
<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-MH4LN5V8');</script>
<!-- End Google Tag Manager -->
<script>
// load Branch
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener banner closeBanner closeJourney data deepview deepviewCta first init link logout removeListener setBranchViewData setIdentity track trackCommerceEvent logEvent disableTracking getBrowserFingerprintId crossPlatformIds lastAttributedTouchData setAPIResponseCallback qrCode".split(" "), 0);
// init Branch
branch.init('key_live_mo8474PtvIkwXvWhRXrtEpmaFEmpaFwY'); // Change `key_live_YOUR_KEY_GOES_HERE` to match your Branch Dashboard
</script>
<title>Kun Branch GTM testing separate Branch SDK</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #eee;
padding: 10px;
position: fixed;
width: 100%;
z-index: 1001;
top: 0; /* Adjust as needed */
}
nav {
background-color: #333;
color: white;
padding: 15px;
text-align: center;
position: fixed;
width: 100%;
top: 140px; /* Adjusted to accommodate the header */
z-index: 1000;
}
nav a {
text-decoration: none;
color: white;
margin: 0 15px;
}
#menu-icon {
display: none;
cursor: pointer;
}
@media only screen and (max-width: 600px) {
nav a {
display: block;
margin: 10px 0;
}
#menu {
display: none;
}
#menu-icon {
display: block;
}
}
/* Added padding for the main content */
main {
padding-top: 200px; /* Adjusted based on the header and navigation bar heights */
text-align: center;
}
table {
margin: 0 auto; /* Center-align the table within the main element */
}
</style>
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MH4LN5V8"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div>
<header>
<h1>Kun Branch GTM JobPlanet</h1>
<h4> This page is in Live key. Testing behalf of JobPlanet Integration</h4>
</header>
</div>
<nav>
<div id="menu-icon">☰</div>
<div id="menu">
<a href="index.html">Live Env</a>
<a href="TestEnv.html">Test Env</a>
<a href="TestDeeplinkDataParse.html">Deeplink Data Parse</a>
<a href="ValueInsertJourney.html">Value Inserting</a>
<a href="#">Event trigger</a>
<a href="GTMBranchTesting.html">GTM Testing</a>
<a href="GTMBranchTestingWithoutBranchSDK.html">GTM Testing Separate Branch SDK</a>
</div>
</nav>
<main>
Clicking the below link will generate custom event with the event name: "AddToCart"
<br>
<br>
<br>
<br>
<a href="#" name="button1" onclick="dataLayer.push({'event': 'addToCart'});">Custom Event: Add To Cart</a>
<br>
<br>
<a href="#" name="button2" onclick="dataLayer.push({'event': 'purchaseEvent'});">Purchase Event</a>
</main>
<script>
document.getElementById('menu-icon').addEventListener('click', function() {
var menu = document.getElementById('menu');
menu.style.display = (menu.style.display === 'block' ? 'none' : 'block');
});
</script>
<script>
function SetDeveloperIdentityEvent(){
var userIdentity = document.getElementById('devId');
if (userIdentity){
branch.setIdentity(userIdentity.value);
alert("the developer identity has been set as:" + userIdentity.value )
}
else{
alert("No input found from devId")
}
}
</script>
</body>
</html>