Created
January 24, 2017 07:55
-
-
Save jaggli/69684e35879f209a88d440025287bb8a to your computer and use it in GitHub Desktop.
DAC config + base tag @ Scout24 Schweiz AG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//methods | |
var | |
dacSuccess = function dacSuccess(){ | |
// set debug mode | |
ADTECH.debugMode = $.asyncScripts.defaults.debug; | |
$.loadDac.loaded = true; | |
$(document).trigger("dac-loaded"); | |
}, | |
dacError = function dacError(){ | |
if( $.asyncScripts.defaults.debug ){ | |
console.log( "DAC failed to load." ); | |
} | |
$.loadDac.loaded = false; | |
$(document).trigger("dac-load-error"); | |
}; | |
// create the ADTECH object | |
var | |
ADTECH = context.ADTECH || { | |
config: { | |
placements: [] | |
}, | |
DACLoader: {} | |
}, | |
viewport = $.asyncScripts.getViewport(); | |
context.ADTECH = ADTECH; | |
// base config | |
ADTECH.config.page = { | |
protocol: "http", | |
server: "adserver.adtech.de", | |
network: "780.1", | |
params: { loc: "100" }, | |
kv: { | |
viewportheight: viewport.height, | |
viewportwidth: viewport.width, | |
} | |
}; | |
// DACLoader config | |
ADTECH.DACLoader = { | |
protocol: "http", | |
onSuccess: dacSuccess, | |
onError: dacError | |
}; | |
// switch url for https sites | |
if( document.location.protocol.indexOf("https") > -1 ){ | |
ADTECH.DACLoader.protocol = "https"; | |
ADTECH.config.page.protocol = "https"; | |
ADTECH.config.page.server = "secserv.adtech.de"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment