-
Notifications
You must be signed in to change notification settings - Fork 26
/
template.tpl
110 lines (91 loc) · 2.34 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
// Copyright 2019 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// https://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
___INFO___
{
"displayName": "Example Template",
"description": "This is an example template. For more information, visit https://developers.google.com/tag-manager/templates",
"categories": ["AFFILIATE_MARKETING", "ADVERTISING"],
"securityGroups": [],
"id": "cvt_temp_public_id",
"type": "TAG",
"version": 1,
"brand": {
"thumbnail": "",
"displayName": "",
"id": "brand_dummy"
},
"containerContexts": [
"WEB"
]
}
___TEMPLATE_PARAMETERS___
[
{
"help": "Enter an example measurement ID. The value can be any character. This is only an example.",
"displayName": "Example Measurement ID",
"defaultValue": "foobarbaz1234",
"name": "MeasurementID",
"type": "TEXT"
}
]
___WEB_PERMISSIONS___
[
{
"instance": {
"key": {
"publicId": "logging",
"versionId": "1"
},
"param": [
{
"key": "environments",
"value": {
"type": 1,
"string": "debug"
}
}
]
},
"isRequired": true
},
{
"instance": {
"key": {
"publicId": "get_referrer",
"versionId": "1"
},
"param": [
{
"key": "urlParts",
"value": {
"type": 1,
"string": "any"
}
}
]
},
"isRequired": true
}
]
___SANDBOXED_JS_FOR_WEB_TEMPLATE___
// Enter your template code here.
const queryPermission = require('queryPermission');
const getReferrerUrl = require('getReferrerUrl');
let referrer;
if (queryPermission('get_referrer', 'query')) {
referrer = getReferrerUrl('queryParams');
}
var log = require('logToConsole');
log('data =', data);
// Call data.gtmOnSuccess when the tag is finished.
data.gtmOnSuccess();
___NOTES___
Created on 9/2/2019, 1:02:37 PM