-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.tpl
125 lines (100 loc) · 4.63 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
___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": "Gorgias Chat",
"categories": ["CHAT", "SALES"],
"brand": {
"id": "gorgias",
"displayName": "Gorgias",
"thumbnail": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAAAjNAAAIVgGWDv7DAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABepJREFUeJztnV+IVHUUx7/nt3dW3I2kcX6/646rrrq2waISiUQGaQ9hUfqS9iL0kkQZ0UMhRA+RCYFSPUiGFOTDFkKZ2JOkUpBBEgjKgiktlO7YvXfcUna0dqZ7eth1sdrde3d2fvPbcc7nZWHvub9z9n7mN/fvnktIhowxK4loCYAFcRxnU6zTCITMHAK4WCwWL7gqgiZbYIxZDuBVAJsA5OtWkRt+BvAFM78XRdFv9Uz8PwH5fL6tUqnsBbAdgFfPYmYBNwDsCcNwF4C/65HwXwJ831/KzF8CWF2P5LOYk5lMZuvg4OBV24nGBeTz+VylUvkewArbSRsBIvoRwPogCEo286hbPyuVyhHIxh+Hmdcw84e28ygA0Fo/C2Cd7WQ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cLh8cGhqatFdQ1WPncrkepdT5Wg98B3KDmd+KomgPUlzf0lp/RURPJoT1qWKx+NPYW+OEqWkjone01sd9319aq0EVADDzKwCm7scrAACIaAMz92utd6IGR5EKAMIwPAXgo5kO1kTMHZsNJ3zfn1F75nGDYRjuAPD1jEtrIohoPTOf1VrvwH/6wymlUnUOvn0KlVtbWzcDOFjDGpuBdiLap7U+eWs2aK3vYuZUzztNaMkYsw3ALgBdNSuzObjJzCeIqBdAmh11X8tEvy2VSme7urr2l0qlARo9SViMFO8bE5AhonsB3JMy/lzaDudeNptd4HneYiJqq7K4hiKO44VE9CKAtRbT9EmL+akh3/e3M/O7SHjfZJX0ydXQqeEgCA4Q0ao075ysBhGQgiAIBoIg2EBEz2O033XNEAHpGZ8NzPxNrQYVAdMkCIKBKIoerdVsEAHVUbPZIAJmQC1mgwiYORwEwYGxSw/fTWdFIrok5wG1Rfm+/zIz7waQdMJ6pVKprBUBFshms4s8z9tCRGai5cz8ayaTOTQ4OHj1H8Jsq14V4+S8AAAAAElFTkSuQmCC"
},
"description": "Customer service made easy",
"containerContexts": [
"WEB"
]
}
___TEMPLATE_PARAMETERS___
[
{
"type": "TEXT",
"name": "gorgiasChatAppKey",
"displayName": "Gorgias Chat App Key",
"simpleValueType": true
}
]
___SANDBOXED_JS_FOR_WEB_TEMPLATE___
const log = require('logToConsole');
const injectScript = require('injectScript');
const encodeUriComponent = require('encodeUriComponent');
const getContainerVersion = require('getContainerVersion');
const containerId = getContainerVersion().containerId;
const chatBundleLoaderUrl = 'https://config.gorgias.chat/bundle-loader/' + encodeUriComponent(data.gorgiasChatAppKey) + '?GTMContainerId=' + encodeUriComponent(containerId);
const onSuccess = () => {
log('Gorgias chat : Successfully loaded');
data.gtmOnSuccess();
};
const onFailure = () => {
log('Gorgias chat : An error occured during loading');
data.gtmOnSuccess();
};
log('Gorgias chat : Initializing...');
injectScript(chatBundleLoaderUrl, onSuccess, onFailure, chatBundleLoaderUrl);
___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://config.gorgias.chat/gorgias-chat-bundle-loader.js?applicationId\u003d*"
}
]
}
}
]
},
"clientAnnotations": {
"isEditedByUser": true
},
"isRequired": true
}
]
___TESTS___
scenarios: []
___NOTES___
Created on 14/10/2021, 10:41:24