This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.tpl
150 lines (121 loc) · 8.25 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
___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___
{
"type": "TAG",
"id": "cvt_temp_public_id",
"version": 1,
"securityGroups": [],
"displayName": "Personaje",
"categories": ["ANALYTICS", "PERSONALIZATION", "REMARKETING"],
"brand": {
"id": "brand_dummy",
"displayName": "",
"thumbnail": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw1AUhU9TpaIVBzuIOGSoThZEpThqFYpQIdQKrTqYvPQPmjQkKS6OgmvBwZ/FqoOLs64OroIg+APi6uKk6CIl3pcUWsR4Hw8+zrvn8t55gNCoMM3qmgA03TbTyYSYza2KoVcE0EcrhrjMLGNOklLwra976qa6i/FZ/n1/Vr+atxgQEIlnmWHaxBvE8U3b4LxPHGElWSU+Jx436YLEj1xXPH7jXHRZ4DMjZiY9TxwhFosdrHQwK5ka8TRxVNV0mi9kPVY5b3HWKjXWuid/YTivryxznfYIkljEEiSIUFBDGRXYlFcZOikW0nSe8PEPu36JXAq5ymDkWEAVGmT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V1kGoRF7OHvAP4QYO++2at2+4qg/9C0kxHltoygXhDew9p4PdfDDiVuHP32539ONrqpyrtHDH4j2x4XgwjjINIvQZCB/AbwghCqVL3R6rUxyxEebJOK0BjT+qZR1jTbwOrnepgy0gV+8SFNH+WBY4nrMQzr0D+vAGcDaxhlVOd3BAh+C9dRPJqNeBg4LeE/Qi7uzuYQ5h3MA44AdjUaqa63uYWnb12D4tu73UfwoCddQkTqNYgbDJib74a4cqCwf888Te9lFSCVSk2AGYKYbNQSQ10YYHg/5TsO/VIqonlgBkFGoAfmYVSc51FsTn9khpqafJP+Z2EnX5So51M/tl925t9UnMNJKzGm6cBOMvsk5rt2JzBPx4Ht0iNNoAwHj1r8E8FRph9UrMdnvPX/2izTmq2/oS97rIG/79wWWqp8Q4iX6//Fmad1Gx9gZdyNAAXm3VS8x2QI/jfIgwYktRgfci32u0+Zp2apr9Z8H9WAv6Q8X+mATebdZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSZIkSXn9DzTmVRkS01ziAAAAAElFTkSuQmCC"
},
"description": "Personaje segments your users into 4 audiences for further personality-based marketing.",
"containerContexts": [
"WEB"
]
}
___TEMPLATE_PARAMETERS___
[
{
"type": "TEXT",
"name": "trackingId",
"displayName": "Personaje tracking id",
"simpleValueType": true
}
]
___SANDBOXED_JS_FOR_WEB_TEMPLATE___
// Require the necessary APIs
const logToConsole = require('logToConsole');
const injectScript = require('injectScript');
const queryPermission = require('queryPermission');
logToConsole('data', data);
// construct URL
const url = 'https://lib.personaje.me/personaje.js?id=' + data.trackingId;
// If the user chose to log debug output, initialize the logging method
const log = data.debug ? logToConsole : (() => {});
log('Loading script from ' + url);
// If the script loaded successfully, log a message and signal success
const onSuccess = () => {
log('Script loaded successfully.');
data.gtmOnSuccess();
};
// If the script fails to load, log a message and signal failure
const onFailure = () => {
log('Script load failed.');
data.gtmOnFailure();
};
if (queryPermission('inject_script', url)) {
injectScript(url, onSuccess, onFailure, url);
} else {
log('injectScript not allowed!');
}
___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://lib.personaje.me/personaje.js?id\u003d*"
}
]
}
}
]
},
"clientAnnotations": {
"isEditedByUser": true
},
"isRequired": true
}
]
___TESTS___
scenarios:
- name: Script injection test
code: |-
const mockData = {
// Mocked field values
trackingId: '123456',
debug: true
};
// Call runCode to run the template's code.
runCode(mockData);
// Verify that the tag finished successfully.
assertApi('gtmOnSuccess').wasCalled();
setup: ''
___NOTES___
Created on 3/3/2023, 10:41:08 AM