Last active
August 29, 2015 13:56
-
-
Save alaahd/8896928 to your computer and use it in GitHub Desktop.
OPT takeovers dfp code
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
<script type="text/javascript"> | |
var adClickURL = "%%CLICK_URL_ESC%%%%DEST_URL%%"; | |
parent.adClickURL = adClickURL; | |
$(document).ready( function() { | |
$(window.parent.document).find('body').css("backgroundColor", "#FFFFFF"); | |
$(window.parent.document).find('body').css("backgroundImage", "url('%%VIEW_URL_UNESC%%https://s3.amazonaws.com/sport360/new-umbro.jpg')"); | |
$(window.parent.document).find('body').css("backgroundPosition", "top center"); | |
$(window.parent.document).find('body').css("backgroundRepeat", "no-repeat"); | |
$(window.parent.document).find('body').css("backgroundAttachment", "fixed"); | |
$(window.parent.document).find('body').addClass("oop"); | |
$(window.parent.document).find('#div-gpt-ad-bg-oop_ad_container').css("cursor", "pointer"); | |
// this is for background impressions tracking | |
var img = $('<img id="dfp_imp">'); | |
img.attr('src', '' + new Date().getTime() + '&rtu=-1'); | |
img.attr('width', '1'); | |
img.attr('height', '1'); | |
img.appendTo('body'); | |
$('#div-gpt-ad-bg-oop_ad_container').click(function() { | |
window.open( | |
adClickURL, | |
'_blank' | |
); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if advertiser didn't provide an IMP tracking URL, please remove or comment the following lines:
var img = $('
');
img.attr('src', '' + new Date().getTime() + '&rtu=-1');
img.attr('width', '1');
img.attr('height', '1');
img.appendTo('body');