<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
/*
// -----------------------------------------
// ID: 07eeafdc-0bd6-4334-be8e-d5b7982d1000
// Campanha: Sesc Todo Dia
// Agência: Calix
// Cliente: Sesc
// Canal: AS ABCDE 18+ ANOS | NACIONAL
// Veículo: Go On
// Criativo: 300x250-STANDARD-html-150-kb
// Linha Criativa: DENTISTA
// Região: AC,AL,AP,AM,BA,CE,DF,ES,GO,MA,MT,MS,MG,PA,PB,PR,PE,PI,RJ,RN,RS,RO,RR,SC,SP,SE,TO
// Data da Veiculação: 13/09/2024 - 13/10/2024
// -----------------------------------------
// Abaixo segue o material para consumo:
*/
</script>
<!--<script src="https://sdk.adftech.com.br/sdk.js" type="text/javascript"></script>-->
<script type="text/javascript">
!function() {
function i() {
try {
return window.top.location.toString();
} catch {
return document.referrer;
}
}
function t() {
console.log("AD POWERED BY AD FORCE"),
this.version = "1.0.0",
this.options = {
baseUrl: "https://api.adftech.com.br",
creativeMetadata: null,
getEventUrl: null,
container: null,
iframe: null,
iframeWrapper: null,
creativeUuid: null,
extension: null,
size: {
width: 0,
height: 0,
expandedWidth: 0,
expandedHeight: 0
},
isExpandable: !1,
cacheBusterMacro: null,
clickMacro: null,
referrerUrlMacro: null
},
this.options.getEventUrl = function(eventType) {
var referrer = i(),
eventUrl = new URL(this.options.baseUrl + "/creative/" + this.options.creativeUuid + "/events/" + eventType);
// Adiciona parâmetros na URL
eventUrl.searchParams.set("ref", encodeURIComponent(referrer));
eventUrl.searchParams.set("t", Date.now());
// Adiciona o cache buster se disponível
if (this.options.cacheBusterMacro && this.options.cacheBusterMacro !== "%%CACHEBUSTER%%") {
eventUrl.searchParams.set("t", this.options.cacheBusterMacro);
}
// Adiciona o referrer URL macro se disponível
if (this.options.referrerUrlMacro && this.options.referrerUrlMacro.indexOf("http") >= 0) {
eventUrl.searchParams.set("ref", this.options.referrerUrlMacro);
}
// Adiciona o clickMacro no final da URL
if (this.options.clickMacro) {
eventUrl.href += "&rd_url=%%CLICK_URL_ESC%%";
}
var img = new Image();
img.crossOrigin = "anonymous";
img.src = eventUrl.toString();
}.bind(this);
}
t.prototype._getAdMetadata = function() {
var referrer = i(),
requestUrl = this.options.baseUrl + "/creative/" + this.options.creativeUuid + "/tag?ref=" + referrer;
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open("GET", requestUrl, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Cache-Control", "no-cache, no-store, must-revalidate");
xhr.setRequestHeader("Expires", "0");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (xhr.status >= 200 && xhr.status < 300) {
resolve(JSON.parse(xhr.responseText));
} else {
reject(new Error("HTTP request failed with status " + xhr.status));
}
}
};
xhr.onerror = function() {
reject(new Error("Network error occurred"));
};
xhr.send();
});
};
t.prototype.withExtension = function(extension) {
this.options.extension = new extension(this.options);
return this;
};
t.prototype.withSize = function(size) {
this.options.size = Object.assign(this.options.size, size);
if (this.options.size.expandedWidth && this.options.size.expandedHeight) {
this.options.isExpandable = true;
}
return this;
};
t.prototype.withContainer = function(container) {
container = (typeof container === "object") ? container : document.querySelector(container);
if (container) {
this.options.container = container;
}
return this;
};
t.prototype.withCreative = function(creativeUuid) {
this.options.creativeUuid = creativeUuid;
return this;
};
t.prototype.withCacheBusterMacro = function(cacheBusterMacro) {
this.options.cacheBusterMacro = cacheBusterMacro;
return this;
};
t.prototype.withClickMacro = function(clickMacro) {
this.options.clickMacro = clickMacro;
return this;
};
t.prototype.withReferrerUrlMacro = function(referrerUrlMacro) {
this.options.referrerUrlMacro = referrerUrlMacro;
return this;
};
t.prototype._iframeInit = function() {
if (this.options.extension) {
this.options.extension.init();
}
};
t.prototype.build = function() {
if (!this.options.container) {
this.withContainer(document.currentScript.parentElement);
}
this.options.container.style.width = this.options.size.width + "px";
this.options.container.style.height = this.options.size.height + "px";
this.options.container.style.margin = "0 auto";
this._getAdMetadata().then(function(metadata) {
this.options.creativeMetadata = metadata;
this.options.iframe = document.createElement("iframe");
this.options.iframe.id = "adf-creative-iframe/" + this.options.creativeUuid;
this.options.iframe.setAttribute("creative", this.options.creativeUuid);
this.options.iframe.width = this.options.size.width;
this.options.iframe.height = this.options.size.height;
this.options.iframe.scrolling = "no";
this.options.iframe.frameBorder = "0";
this.options.iframe.tabIndex = 0;
this.options.iframe.ariaLabel = "Advertisement";
this.options.iframe.style.cssText = "position: relative; border: none; overflow: hidden; vertical-align: bottom;";
this.options.iframe.addEventListener("load", this._iframeInit.bind(this));
this.options.iframe.src = metadata.media;
this.options.iframeWrapper = document.createElement("div");
this.options.iframeWrapper.style.cssText = "position: relative; display:inline-block; clear: both;";
this.options.iframeWrapper.style.width = this.options.size.width + "px";
this.options.iframeWrapper.style.height = this.options.size.height + "px";
this.options.iframeWrapper.appendChild(this.options.iframe);
this.options.container.appendChild(this.options.iframeWrapper);
}.bind(this));
};
window.AdSDK = window.AdSDK || t;
}();
</script>
<script src="https://sdk.adftech.com.br/sdk-standard-extension.js" type="text/javascript"></script>
<script type="text/javascript">
new AdSDK()
.withExtension(AdSDKExtension.STANDARD)
.withSize({"width":"300px","height":"250px"})
.withCreative('07eeafdc-0bd6-4334-be8e-d5b7982d1000')
.withCacheBusterMacro('${CACHEBUSTER}')
.withReferrerUrlMacro('%%REFERRER_URL_ESC%%')
.build();
</script>
</body>
</html>
21
4
42KB
47KB
929.0ms
ms
929.0ms