and terms & conditions.'); //$(".cookie_stng [data-box][data-box!='cookietabNewsletter']").remove(); //$(".cookie_stng [data-target][data-target!='cookietabNewsletter']").addClass('hideit'); $(".cookie_stng [data-target='cookietabNewsletter']").removeClass('hideit'); $(".cookie_stng [data-target='cookietabNewsletter']").trigger('click'); setTimeout(function(){ $(".cookie_stng [data-target='cookietabNewsletter']").trigger('click'); },500); } $(".cookie_stng").removeClass('hide'); }); }, postConsentToPersonalisationAPI : function(consent){ var userIdentifier = b2bGdpr.useridentifier; $.ajax({ url: 'https://etservices2.indiatimes.com/ET_B2B_WEB/consent', method:'POST', contentType:'application/json', processData: false, data: JSON.stringify(consent), beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", userIdentifier); xhr.setRequestHeader("X-PRIMARY", userIdentifier); }, success: function(data) { console.log('xxxxxxxxxxxxxx'); console.log(data); } }); }, postConsentToB2BAPI : function(consent){ var userIdentifier = b2bGdpr.useridentifier; $.ajax({ url: base_url+'/ajax_files/etb2b_gdpr_mailer_consent.php?email='+b2bGdpr.useremail+'&personlisationid='+userIdentifier, method:'POST', data: { 'consent':JSON.stringify(consent), }, success: function(data) { console.log('xxxxxxxxxxxxxx'); console.log(data); } }); }, getConsentFromPersonalisationAPI : function(){ var userIdentifier = b2bGdpr.useridentifier; $.ajax({ url: 'https://etservices2.indiatimes.com/ET_B2B_WEB/consent', method:'GET', contentType:'application/json', beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", userIdentifier); xhr.setRequestHeader("X-PRIMARY", userIdentifier); }, success: function(data) { console.log('xxxxxxxxxxxxxx'); console.log(data); } }); }, getFingerprint : function() { function checksum(str) { var hash = 5381,i = str.length; while (i--) hash = (hash * 33) ^ str.charCodeAt(i); return hash >>> 0; } function map(arr, fn){ var i = 0, len = arr.length, ret = []; while(i < len){ ret[i] = fn(arr[i++]); } return ret; } return checksum([ navigator.userAgent, [screen.height, screen.width, screen.colorDepth,b2bGdpr.userip].join('x'), new Date().getTimezoneOffset(), !!window.sessionStorage, !!window.localStorage, map(navigator.plugins, function (plugin) { return [ plugin.name, plugin.description, map(plugin, function (mime) { return [mime.type, mime.suffixes].join('~'); }).join(',') ].join("::"); }).join(';') ].join('###')); }, getUserIP : function(onNewIP) { // onNewIp - your listener function for new IPs //compatibility for firefox and chrome var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; var pc = new myPeerConnection({ iceServers: [] }), noop = function() {}, localIPs = {}, ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g, key; function iterateIP(ip) { if (!localIPs[ip]) onNewIP(ip); localIPs[ip] = true; } //create a bogus data channel pc.createDataChannel(""); // create offer and set local description pc.createOffer().then(function(sdp) { sdp.sdp.split('\n').forEach(function(line) { if (line.indexOf('candidate') < 0) return; line.match(ipRegex).forEach(iterateIP); }); pc.setLocalDescription(sdp, noop, noop); }).catch(function(reason) { // An error occurred, so handle the failure to connect }); //listen for candidate events pc.onicecandidate = function(ice) { if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return; ice.candidate.candidate.match(ipRegex).forEach(iterateIP); }; } }; b2bGdpr.init(); function isGDPRNation(){ return false; if(typeof b2bGdpr != 'undefined' && typeof b2bGdpr.isgdprnation != 'undefined' && b2bGdpr.isgdprnation == 1) return true; else return false; } if(!isGDPRNation()){ b2bGdpr.ga.optin(); b2bGdpr.setCookie('optout',1,-1,'.indiatimes.com'); } else if (document.cookie.indexOf(b2bGdpr.ga.disablestr + '=true') > -1) { window[b2bGdpr.ga.disablestr] = true; }