-
Notifications
You must be signed in to change notification settings - Fork 2
/
template.tpl
128 lines (107 loc) · 7.7 KB
/
template.tpl
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
___TERMS_OF_SERVICE___
By creating or modifying this file you agree to Google Tag Manager's Community
Template Gallery Developer Terms of Service available at
https://developers.google.com/tag-manager/gallery-tos (or such other URL as
Google may provide), as modified from time to time.
___INFO___
{
"displayName": "Quantum Metric JS Tag",
"description": "JavaScript tag to capture high-fidelity user-experience data",
"categories": ["ANALYTICS", "HEAT_MAP", "SESSION_RECORDING"],
"securityGroups": [],
"id": "cvt_temp_public_id",
"type": "TAG",
"version": 1,
"brand": {
"thumbnail": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3xpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlv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ZhT1ylXA/0wNMp5ME8F3twscbej7wjLTiFWKX4ciKY7/0CzvOxfkYuE63bWvGSBQrnNRWTFSeQNwR5L7uL2Lh2dQvp9X6Pn8CFOlscMbjjqFoYZo27kxiKpi/0HCnr8oasCVwMTYlVQGS2bSu/Q37HxTKvgvPJ/IHt+8SyNoUPmYdRwNyUaRc4TiAkF0dfOhkoq1qmpFCB/UUFTjssvMAmzhrjZAUO+IWOVnXdik4ykEzmi4hr3T5kMBQ5F9gsYAwNpHB+dhzNPYgM75/nApvHBAqeFgqnBREcsch0ZXKBdXAN+bu9ZoU4SpCcVcWvnQusA5w1vt7HZ5C5CEEGapZuLrAeHqPiN54jpxZ8y+o5T3KB9bBCDK7GVYwwxI0jhbCVqJBcYF2MLVgX/yJWMgL3rG2e5I4OO0Dymtlk6QhMoaOjVd7JrGBqXF+cqR6cRfwnwADz9N6cJI2wuwAAAABJRU5ErkJggg==",
"displayName": "",
"id": "brand_dummy"
},
"containerContexts": [
"WEB"
]
}
___TEMPLATE_PARAMETERS___
[
{
"displayName": "Sub Name",
"simpleValueType": true,
"name": "subName",
"type": "TEXT",
"valueValidators": [
{
"type": "NON_EMPTY"
}
],
"help": "Enter your QM sub name. For example, you'd enter amazingcompany if your QM URL was https://amazingcompany.quantummetric.com.",
"notSetText": "Sub Name is required"
}
]
___WEB_PERMISSIONS___
[
{
"instance": {
"key": {
"publicId": "logging",
"versionId": "1"
},
"param": [
{
"key": "environments",
"value": {
"type": 1,
"string": "debug"
}
}
]
},
"isRequired": true
},
{
"instance": {
"key": {
"publicId": "inject_script",
"versionId": "1"
},
"param": [
{
"key": "urls",
"value": {
"type": 2,
"listItem": [
{
"type": 1,
"string": "https://cdn.quantummetric.com/"
}
]
}
}
]
},
"clientAnnotations": {
"isEditedByUser": true
},
"isRequired": true
}
]
___SANDBOXED_JS_FOR_WEB_TEMPLATE___
// Enter your template code here.
var log = require('logToConsole');
var injectScript = require('injectScript');
var encodeUriComponent = require('encodeUriComponent');
const subName = data.subName;
log("subName: "+subName);
const encSubName = encodeUriComponent(subName);
log("encSubName: "+encSubName);
const url = "https://cdn.quantummetric.com/qscripts/quantum-"+encSubName+".js";
function onFailure() {
log("Failed to load Quantum Metric library");
data.gtmOnFailure();
}
function onSuccess() {
log("Loaded Quantum Metric library");
data.gtmOnSuccess();
}
injectScript(url, onSuccess, onFailure);
___NOTES___
Created on 9/9/2019, 1:24:13 PM