Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var d= new Date()
- if(window.location.href.substring(7, 11).includes("www")){href = 2}else{href = 1}
- d.setYear(d.getFullYear()+2)
- document.cookie = document.cookie.split(";").forEach(function(cookie){
- if(cookie.includes("_fbc")||cookie.includes("_fbp")){
- document.cookie = cookie + ";expires=" + d.toUTCString()+";"
- }
- })
- if(!document.cookie.includes("_fbp")){
- const random = 1000000000 + parseInt(Math.random()* 9999999999)
- var cookie = "_fbp=fb."+href+"."+Date.now()+"."+random+";expires=" + d.toUTCString()+";"
- document.cookie= cookie
- }
- if(!document.cookie.includes("_fbc")){
- var match = RegExp('[?&]' + "fbclid" + '=([^&]*)').exec(window.location.search)
- if(match){
- var cookie = "_fbc=fb."+href+"."+Date.now()+"."+decodeURIComponent(match[1].replace(/\+/g, ' '))+";expires=" + d.toUTCString()+";"
- document.cookie= cookie
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement