-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_layer_debug_tools.js
56 lines (49 loc) · 1.58 KB
/
data_layer_debug_tools.js
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
dataLayer.push({
event: "test",
eventModel: {
transaction_id: "4190",
coupon: null,
value: 12.35,
shipping: 12.9,
tax: 0,
currency: "BRL",
items: [{
list_position: 0,
name: "Teste",
variant: null,
product_title: "Teste",
product_id: "8061528768795",
variant_title: null,
category: "",
variant_id: "44265532915995",
quantity: 1,
id: "",
sku: "",
price: 0.1
}]
},
})
const domain = window.location.hostname;
function setCookie(cookieName, cookieValue, expirationTime) {
expirationTime = expirationTime * 1000;
let date = new Date();
let dateTimeNow = date.getTime();
date.setTime(dateTimeNow + expirationTime);
date = date.toUTCString();
document.cookie =
cookieName +
"=" +
cookieValue +
"; expires=" +
date +
"; path=/; domain=" +
domain;
return cookieValue;
}
console.log('test')
/** Sets _ttp, _fbp, _fbc, ttclid, gclid cookies for 60 * 60 * 24 * 365 */
setCookie("_ttp", "HxUDi52cBXnnSVouGgRHQa5bIGd", 60 * 60 * 24 * 365);
setCookie("_fbc", "fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890", 60 * 60 * 24 * 365);
setCookie("ttclid", "CyARIsAJrtdr7OMWygINU5NFCm8G", 60 * 60 * 24 * 365);
setCookie("gclid", "Cj0KCQiAq5meBhCyARIsAJrtdr7OMWygINU5NFCm8GyeavAabLfArYh9j7qbKHb-an40LK82v6O1QvAaAmRoEALw_wcB", 60 * 60 * 24 * 365);
setCookie("_fbp", "'fb.2.1672238630727.1518967754'", 60 * 60 * 24 * 365);