-
Notifications
You must be signed in to change notification settings - Fork 1
/
migrate.html
284 lines (267 loc) · 14.5 KB
/
migrate.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<html>
<head>
<title>GA App+Web Migration Tool</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.3.0/mustache.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js"></script>
<script type="text/javascript" src="javascripts/auth.js"></script>
<script type="text/javascript" src="javascripts/gtm-functions.js"></script>
<script type="text/javascript" src="javascripts/utils.js"></script>
<script type="text/javascript" src="javascripts/renderjson.js"></script>
<script src="https://apis.google.com/js/client.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<!-- Stepper -->
<script src="https://cdn.jsdelivr.net/npm/bs-stepper/dist/js/bs-stepper.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bs-stepper/dist/css/bs-stepper.min.css" />
<script type="text/javascript">
var stepper = null;
$(document).ready(function () {
stepper = new Stepper($('.bs-stepper')[0])
})
</script>
<!-- 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-W2575GD');</script>
<!-- End Google Tag Manager -->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="/">GA App+Web Migration Tool</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul id="ulMenu" class="navbar-nav ml-auto">
<li class="nav-item">
<a class="js-scroll-trigger btn btn-primary btn-m" href="migrate.html">Launch</a>
</li>
<li id="liLogout" class="nav-item" style="display:none">
<a class="nav-link js-scroll-trigger" onclick="handleLogoutClick()" href="#">Logout</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container flex-grow-1 flex-shrink-0 py-5">
<div class="col-lg-8 mx-auto mb-5 p-3 bg-white shadow-sm align-items-center justify-content-center">
<div id="divAuthorization" class="row p-4">
<div id="divSignIn">
<div class="row align-items-center justify-content-center ">
<h2 class="p-3">Authorize to Get Started</h2>
</div>
<p>
In order to migrate your Universal Analytics tags, the Migration Tool requires access via Google's OAuth procedure. None of your personal or GTM account information is stored or transmitted anywhere.
</p>
<div class="row align-items-center justify-content-center ">
<p>
<button id="authorize-button" onclick="handleAuthClick(event)">
Sign-In/Authorize
</button>
</p>
</div>
<p> Having trouble logging in? Make sure 3rd party cookies aren't being blocked.</p>
<img src="images/cookies.png" />
</div>
</div>
<!-- BEGIN STEPPER-->
<div id="divStepper" class="bs-stepper linear" style="display:none">
<!-- STEPPER STEPS -->
<div class="bs-stepper-header" role="tablist">
<div class="step" data-target="#accounts-part">
<button type="button" class="step-trigger" role="tab" aria-controls="accounts-part" id="accounts-part-trigger">
<span class="bs-stepper-circle">1</span>
<span class="bs-stepper-label">Choose Account</span>
</button>
</div>
<div class="step" data-target="#information-part">
<button type="button" class="step-trigger" role="tab" aria-controls="information-part" id="information-part-trigger">
<span class="bs-stepper-circle">2</span>
<span class="bs-stepper-label">Choose Container</span>
</button>
</div>
<div class="step" data-target="#settings-part">
<button type="button" class="step-trigger" role="tab" aria-controls="settings-part" id="settings-part-trigger">
<span class="bs-stepper-circle">3</span>
<span class="bs-stepper-label">Map Settings</span>
</button>
</div>
<div class="step" data-target="#tags-part">
<button type="button" class="step-trigger" role="tab" aria-controls="tags-part" id="tags-part-trigger">
<span class="bs-stepper-circle">4</span>
<span class="bs-stepper-label">Migrate</span>
</button>
</div>
</div>
<!-- STEPPER CONTENT -->
<div class="bs-stepper-content">
<div id="accounts-part" class="bs-stepper-pane" role="tabpanel" aria-labelledby="accounts-part-trigger">
<div id="divAccountsList"></div>
</div>
<div id="information-part" class="bs-stepper-pane" role="tabpanel" aria-labelledby="information-part-trigger">
<div id="divContainersList"></div>
</div>
<div id="settings-part" class="bs-stepper-pane" role="tabpanel" aria-labelledby="settings-part-trigger">
<div id="divSettingsList"></div>
</div>
<div id="tags-part" class="content" role="tabpanel" aria-labelledby="tags-part-trigger">
<div id="divTagsList" style="max-width:800px"></div>
</div>
</div>
</div>
<div id="divProgress"></div>
<div id="divSuccess"></div>
</div>
</div>
<div class="toast" id="myToast" data-autohide="false" style="position: absolute; top: 0; right: 0;">
<div class="toast-header">
<strong class="mr-auto"><i class="fa fa-grav"></i> Error</strong>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast">×</button>
</div>
<div id="toastBody" class="toast-body">
</div>
</div>
<!-- Footer -->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright © Noise to Signal 2020. Feedback: <a class="text-light" href="mailto:[email protected]">[email protected]</a></p>
<p class="m-0 text-center text-white">HTML template provided by <a class="text-light" href="https://startbootstrap.com/">Start Boostrap</a></p>
</div>
<!-- /.container -->
</footer>
<!-- Template code-->
<script id="templateAccountsList" type="text/x-handlebars-template">
<table class="table">
<thead class="thead-light"><tr><th scope="col">Account Name</th><th scope="col">ID</th><th scope="col"></th></tr></thead>
{{#accounts}}
<tr><td>{{name}}</td><td>{{accountId}}</td><td><button onclick="handleLoadAccountClick('{{accountId}}');">Load</button></td></tr>
{{/accounts}}
</table>
</script>
<script id="templateContainersList" type="text/x-handlebars-template">
<div id="divWorkspaceError"></div>
<table class="table">
<thead class="thead-light"><tr><th scope="col">Container Name</th><th scope="col">ID</th><th scope="col"></th></tr></thead>
{{#containers}}
<tr><td>{{name}}</td><td>{{publicId}}</td><td><button onclick="handleLoadContainerClick('{{containerId}}');">Select</button></td></tr>
{{/containers}}
</table>
</script>
<script id="templateSettingsMap" type="text/x-handlebars-template">
Use the table below to create a link between Universal Analytics settings variables on the left and the App+Web configuration tags on the right. Tags migrated in the next step will respect these mappings.
<br />
<br />
<table class="table">
<thead class="thead-light"><tr><th scope="col">UA Settings</th><th scope="col">Tracking ID</th><th scope="col">Map to GAAW Config</th></tr></thead>
{{#settings}}
<tr>
<td>{{name}}</td>
<td>{{trackingId}}</td>
<td>
<select id="selChooseConfig{{variableId}}">
{{#configs}}
<option value="{{name}}">{{name}} ({{measurementId}})</option>
{{/configs}}
</select>
</td>
</tr>
{{/settings}}
</table>
Select a default App+Web config tag for tags with no GA Settings assigned:
<br />
<select id="selDefaultConfigTag">
{{#configs}}
<option value="{{name}}">{{name}} - {{measurementId}}</option>
{{/configs}}
</select>
<br />
<br />
<button id="btnSettingsContinue" onclick="handleSetingsContinueClick('map')">Continue</button>
</script>
<script id="templateSettingsOneOrNoSettings" type="text/x-handlebars-template">
Select an App+Web configuration tag. All UA tags will be linked to this configuration tag.
<br />
<select id="selConfigTag">
{{#configs}}
<option value="{{tagId}}">{{name}} - {{measurementId}}</option>
{{/configs}}
</select>
<br />
<br />
<button id="btnSettingsContinue" onclick="handleSetingsContinueClick('oneOrNoSettings')">Continue</button>
</script>
<script id="templateSettingsNoConfigs" type="text/x-handlebars-template">
<form onsubmit="handleSetingsContinueClick('newConfig'); return false;">
No App+Web configuration tags exist in the workspace. Supply a measurement ID below to create one, or return to GTM to create one and restart this process.
<br />
<br />
<b>Enter a Measurement ID:</b> <input type="text" pattern="G-\w{10}" placeholder="G-XXXXXXXXXX" id="txtMeasurementId" required />
<br />
<input type="submit" id="btnSettingsContinue" value="Continue" />
</form>
</script>
<script id="templateTagsList" type="text/x-handlebars-template">
Showing {{numTagsInterest}} UA tags out of {{numTagsTotal}} total tags.
<br />
<br />
<button id="btnMigrateTags" onclick="handleMigrateTagsClick();">Continue</button>
<br />
<br />
<table class="table">
<thead class="thead-light"><tr><th>Tag Name</th><th>Type</th><th>Action</th><th>Preview</th></tr></thead>
{{#tags}}
<tr>
<td>{{name}}</td>
<td>{{tagTypeLabel}}</td>
<td>
<select data-tag-id="{{tagId}}" name="tagAction{{tagId}}" id="selTagAction{{tagId}}" onchange="handleActionChange(this);">
{{#actions}}
<option value="{{value}}" {{selected}}>{{label}}</option>
{{/actions}}
</select>
</td>
<td id="tdPreview{{tagId}}">
</td>
</tr>
{{/tags}}
</table>
</script>
<script id="templateProgress" type="text/x-handlebars-template">
Migrated {{numTags}} tags.
</script>
<script id="templateSuccess" type="text/x-handlebars-template">
<div class="row align-items-center justify-content-center ">
<h2 class="p-3">Success!</h2>
</div>
<p>
You migrated {{numTags}} tags. <a id="aWorkspaceLink" href="">Click to view your workspace</a>.
</p>
</script>
<!-- Load template strings-->
<script type="text/javascript">
var templateAccountsList = $('#templateAccountsList').html();
var templateContainersList = $('#templateContainersList').html();
var templateSettingsMap = $('#templateSettingsMap').html();
var templateSettingsOneOrNoSettings = $('#templateSettingsOneOrNoSettings').html();
var templateSettingsNoConfigs = $('#templateSettingsNoConfigs').html();
var templateTagsList = $('#templateTagsList').html();
var templateSuccess = $('#templateSuccess').html();
var templateProgress = $('#templateProgress').html();
</script>
<script async defer src="https://apis.google.com/js/api.js"
onload="this.onload=function(){};handleClientLoad()"
onreadystatechange="if (this.readyState === 'complete') this.onload()">
</script>
</body>
</html>