-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.tpl
233 lines (193 loc) · 24.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
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
___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": "MACRO",
"id": "cvt_temp_public_id",
"version": 1,
"securityGroups": [],
"displayName": "Generate Session String",
"thumbnail": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAMPWlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnltSIbQAAlJCb4JIDSAlhBZAeheVkAQIJcZAULGjiwquXSxgQ1dFFDvNgiJ2FsXeFwsqyrpYsCtvUkDXfeV75/vm3v/+c+Y/Z86dWwYA9eNcsTgP1QAgX1QoiQ0JYCSnpDJITwECUEAD1oDM5RWIWdHREQDa4Pnv9u469IZ2xUGm9c/+/2qafEEBDwAkGuIMfgEvH+KDAOBVPLGkEACijDefXCiWYdiAtgQmCPECGc5S4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AoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEACFACBAChAAhQAgQAoQAIUAIEAKEwIcdgf8HznErfBLojegAAAAASUVORK5CYII\u003d",
"description": "Creates a Session String with a Session ID which is a Linux timestamp in seconds when the session started, Session Number, and Update Timestamp.",
"containerContexts": [
"SERVER"
]
}
___TEMPLATE_PARAMETERS___
[
{
"type": "TEXT",
"name": "cookieName",
"displayName": "Name of the Session Cookie",
"simpleValueType": true,
"defaultValue": "_fp_custom_session"
},
{
"type": "TEXT",
"name": "lifetimeMinutes",
"displayName": "Lifetime of the Session in Minutes",
"simpleValueType": true,
"valueValidators": [
{
"type": "POSITIVE_NUMBER"
}
],
"defaultValue": 30
}
]
___SANDBOXED_JS_FOR_SERVER___
const getCookieValues = require("getCookieValues");
const getTimestampMillis = require("getTimestampMillis");
const logToConsole = require('logToConsole');
const makeNumber = require('makeNumber');
const Math = require('Math');
const cookie_name = data.cookieName||"_fp_custom_session";
const session_lifetime_mins = data.lifetimeMinutes||30;
const separator = ".";
function removeDigits(myNumber, digitsToRemove){
return (myNumber- (myNumber%Math.pow(10, digitsToRemove)))/Math.pow(10, digitsToRemove);
}
const current_timestamp_seconds = removeDigits(getTimestampMillis(),3);
const update_session_cookie = function (curent_session_number, current_session_id) {
logToConsole(curent_session_number);
let session_number = current_session_id && curent_session_number ? curent_session_number : curent_session_number++;
logToConsole(curent_session_number);
const session_id = current_session_id || current_timestamp_seconds;
const session_array = [session_id,curent_session_number,current_timestamp_seconds];
const session_string = session_array.join(separator);
logToConsole({session_string: session_string});
//data.gtmOnSuccess();
return session_string;
};
//readSessionCookie
const cookie = getCookieValues(cookie_name, true);
//ExtractSession ID, Number
if(cookie.length) {
logToConsole(cookie);
const cookieArray = cookie[0].split(".");
//Need to check if timestamps are 10 digits long to ensure long session cookie is migrated to short one. Otherwise cut last 3 digits.
const cookie_timestamp_seconds = cookieArray[2].length === 10 ? cookieArray[2] : removeDigits(cookieArray[2],3);
const cookie_session_no = makeNumber(cookieArray[1]);
const cookie_session_id = cookieArray[0].length === 10 ? cookieArray[0] : removeDigits(cookieArray[0],3);
if(current_timestamp_seconds - cookie_timestamp_seconds > session_lifetime_mins * 60) {
logToConsole("Session older than session lifetime");
return update_session_cookie(cookie_session_no, undefined);
} else {
logToConsole("still the same session");
return update_session_cookie(cookie_session_no,cookie_session_id);
}
} else {
logToConsole("New user");
return update_session_cookie(0);
}
data.gtmOnSuccess();
___SERVER_PERMISSIONS___
[
{
"instance": {
"key": {
"publicId": "get_cookies",
"versionId": "1"
},
"param": [
{
"key": "cookieAccess",
"value": {
"type": 1,
"string": "any"
}
}
]
},
"clientAnnotations": {
"isEditedByUser": true
},
"isRequired": true
},
{
"instance": {
"key": {
"publicId": "logging",
"versionId": "1"
},
"param": [
{
"key": "environments",
"value": {
"type": 1,
"string": "debug"
}
}
]
},
"isRequired": true
}
]
___TESTS___
scenarios:
- name: sessionOlderThenLifetime
code: |-
const mockData = {
// Mocked field values
};
mock("getCookieValues", (name, encode) => {
return ["1081019399.1.1689095333"];
});
mock("setCookie", (cookieName, cookieValue, cookieSettings) => {
if (cookieName === "_fp_custom_session") {
const cookieTimstamp = cookieValue.split(".")[1];
assertThat(cookieTimstamp).isEqualTo("2");
}
else {
fail("Unexpected cookie: " + cookieName);
}
});
// Call runCode to run the template's code.
runCode(mockData);
- name: old Cookie sessionOlderThenLifetime
code: |-
const mockData = {
// Mocked field values
};
mock("getCookieValues", (name, encode) => {
return ["1081019399000.1.1689095333000"];
});
mock("setCookie", (cookieName, cookieValue, cookieSettings) => {
if (cookieName === "_fp_custom_session") {
const cookieTimstamp = cookieValue.split(".")[1];
assertThat(cookieTimstamp).isEqualTo("2");
}
else {
fail("Unexpected cookie: " + cookieName);
}
});
// Call runCode to run the template's code.
runCode(mockData);
- name: same Session
code: |
const mockData = {
// Mocked field values
};
// Mocking getCookieValues function to return a session cookie with a timestamp 30 minutes ago
mock("getCookieValues", (name, encode) => {
return ['1716752835.2.1716752835'];
});
// Mocking setCookie function to check if the session ID remains constant after an event within 30 minutes
mock("setCookie", (cookieName, cookieValue, cookieSettings) => {
if (cookieName === "_fp_custom_session") {
// Splitting cookie value to extract session ID
const sessionId = cookieValue.split(".")[0];
// Asserting that the session ID remains constant after an event within 30 minutes
assertThat(sessionId).isEqualTo("1716752835");
} else {
fail("Unexpected cookie: " + cookieName);
}
});
// Call runCode to run the template's code.
runCode(mockData);
setup: ''
___NOTES___
Created on 12/07/2023, 11:07:43