<script type='text/javascript'>
Base64 = {
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode: function(r) {
var e, i, t, a, n, c, s, o = "",
d = 0;
for (r = Base64._utf8_encode(r); d < r.length;) a = (e = r.charCodeAt(d++)) >> 2, n = (3 & e) << 4 | (i = r.charCodeAt(d++)) >> 4, c = (15 & i) << 2 | (t = r.charCodeAt(d++)) >> 6, s = 63 & t, isNaN(i) ? c = s = 64 : isNaN(t) && (s = 64), o = o + this._keyStr.charAt(a) + this._keyStr.charAt(n) + this._keyStr.charAt(c) + this._keyStr.charAt(s);
return o
},
decode: function(r) {
var e, i, t, a, n, c, s = "",
o = 0;
for (r = r.replace(/[^A-Za-z0-9+/=]/g, ""); o < r.length;) e = this._keyStr.indexOf(r.charAt(o++)) << 2 | (a = this._keyStr.indexOf(r.charAt(o++))) >> 4, i = (15 & a) << 4 | (n = this._keyStr.indexOf(r.charAt(o++))) >> 2, t = (3 & n) << 6 | (c = this._keyStr.indexOf(r.charAt(o++))), s += String.fromCharCode(e), 64 != n && (s += String.fromCharCode(i)), 64 != c && (s += String.fromCharCode(t));
return s = Base64._utf8_decode(s)
},
_utf8_encode: function(r) {
r = r.replace(/rn/g, "n");
for (var e = "", i = 0; i < r.length; i++) {
var t = r.charCodeAt(i);
t < 128 ? e += String.fromCharCode(t) : t > 127 && t < 2048 ? (e += String.fromCharCode(t >> 6 | 192), e += String.fromCharCode(63 & t | 128)) : (e += String.fromCharCode(t >> 12 | 224), e += String.fromCharCode(t >> 6 & 63 | 128), e += String.fromCharCode(63 & t | 128))
}
return e
},
_utf8_decode: function(r) {
for (var e = "", i = 0, t = c1 = c2 = 0; i < r.length;)(t = r.charCodeAt(i)) < 128 ? (e += String.fromCharCode(t), i++) : t > 191 && t < 224 ? (c2 = r.charCodeAt(i + 1), e += String.fromCharCode((31 & t) << 6 | 63 & c2), i += 2) : (c2 = r.charCodeAt(i + 1), c3 = r.charCodeAt(i + 2), e += String.fromCharCode((15 & t) << 12 | (63 & c2) << 6 | 63 & c3), i += 3);
return e
}
}
var xmlhttp;
var params = '';
var clickUrl = Base64.encode("%click_url_unesc%");
// var clickUrl = Base64.encode("https://www.toyota.astra.co.id/product/new-fortuner-gr-sport");
var cb = "%ts%";
var smartMacros = {
"site_ms": "%placement_name%",
"gdpr": "%gdpr%",
"gdpr_consent": "%consent%",
"addtl_consent": "%consent%",
"variant_name": "cads-ott-854x480"
};
// Set the callback to a timestamp if default is 'cb'
if (cb === 'cb') {
cb = Math.round(new Date().getTime() / 1000);
}
// Append smart macro parameters
for (var key in smartMacros) {
params += "&" + key + "=" + encodeURIComponent(smartMacros[key]);
}
// Attempt to add domain parameter
try {
var domain = (window.location !== window.parent.location) ? document.referrer : document.location.hostname;
params += "&domain=" + encodeURIComponent(new URL(domain).hostname.replace('www.', '').replace('//', ''));
} catch (e) {}
// Initialize the XML HTTP request object
xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
let banner_id = 32495;
let zone_id = 2396;
// Handle the state change of the request
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState === XMLHttpRequest.DONE && xmlhttp.status === 200) {
var iframe = document.getElementById('cads-ott');
console.log(xmlhttp.responseText);
console.log('?c=' + encodeURIComponent(clickUrl) +
'&cb=' + encodeURIComponent(cb) + params + '&s=doubleclick');
iframe.setAttribute('src', xmlhttp.responseText + '?c=' + encodeURIComponent(clickUrl) +
'&clkSt=' + encodeURIComponent(clickUrl) +
'&clkEx=' + encodeURIComponent(clickUrl) +
'&clickTrack=true'+
'oaparams=2__bannerid='+banner_id+'__zoneid='+zone_id+
'__oadest='+encodeURIComponent(clickUrl)+
'&cb=' + encodeURIComponent(cb) + params + '&s=doubleclick');
console.log(xmlhttp.responseText + '?c=' + encodeURIComponent(clickUrl) +
'&clkSt=' + encodeURIComponent(clickUrl) +
'&clkEx=' + encodeURIComponent(clickUrl) +
'&clickTrack=true'+
'&cb=' + encodeURIComponent(cb) + params + '&s=doubleclick');
}
};
// Create and insert the iframe element
var iframeHtml = '<body style="margin: 0;">' +
'<iframe id="cads-ott" allow="autoplay; geolocation" allowfullscreen="true" ' +
'width="854" height="480" scrolling="no" marginheight="0" marginwidth="0" ' +
'hspace="0" vspace="0" frameborder="0"></iframe>' +
'</body>';
document.write(iframeHtml);
// Open and send the HTTP request
xmlhttp.open("GET", "//admin.contextads.live/ott/Oct24/indomilk/indomilk.php", true);
xmlhttp.send();
</script>
2
2
2KB
5KB
196.0ms
ms
197.0ms