forked from AllanTracker/codigos-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJSC - elementor cross domain.txt
32 lines (30 loc) · 1 KB
/
JSC - elementor cross domain.txt
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
<script>
document.addEventListener("DOMContentLoaded", function() {
var form = document.querySelector('form[name="checkout"]');
if (form) {
form.addEventListener('submit', function(e) {
function getCookie(name) {
let cookies = document.cookie.split("; ");
for (let i = 0; i < cookies.length; i++) {
let cookie = cookies[i].split("=");
if (cookie[0] === name) {
return cookie[1] || '';
}
}
return '';
}
var gaValue = getCookie("_ga");
var gaX5Value = getCookie("_ga_XXXXXXXXXX");
if (gaValue && gaX5Value) {
var a = gaValue.substr(6);
var b = gaX5Value.substr(6);
var c = window.google_tag_data.glBridge.generate({_ga: a, _ga_XXXXXXXXX: b});
var d = document.getElementById("form-field-cross");
if (d) {
d.value = c;
}
}
});
}
});
</script>