TRAFFIC WALLPAPER AD (WITH CLICK FUNCTION)

Yes, trafficking a wallpaper Ad in DFP SB is possible.

Wallpaper Ad is served using a AdUnit of size 1×1, and is implemented on the webpage with no special requirement, and same as other IAB size (728×90, 300×250, 160×600 etc.) AdUnits.

Step 1: Ensure that you’ve the 1×1 AdUnit code (sync only) implemented on the page that you want to serve wallpaper Ad on.

Step 2: Create a line item in DFP with inventory size 1×1, and target this Ad to the Ad Unit that you created for the 1×1 wallpaper.

Step 3: Select Custom creative type, and use the code snippet given below to show your wallpaper Ad. Along with the custom code you’ll need to upload the wallpaper image, and replace the placeholder in the code snippet with the File Macro.

Step 4: Set the Ad live in DFP

Wallpaper Code Snippet: Field marked in bold red are to be replaced accordingly

<script type=”text/javascript”>

var accClickUrl = “%%CLICK_URL_UNESC%%CLICK URL GOES HERE“;

var accClickTarget = “_blank”;

document.write(‘<style>’);

document.write(‘body {‘);

document.write(‘background-image: url(“IMAGE URL GOES HERE“);’);

document.write(‘background-repeat: no-repeat;’);

if(‘top’==’top with offset’) {

document.write(‘background-position:center 0px;’);

}else{

document.write(‘background-position:center top;’);

}

if(‘FFFFFF’!=””)document.write(‘background-color: #FFFFFF;’);

document.write(‘background-attachment: fixed;’);

if (accClickUrl != “”)document.write(‘cursor: pointer;’);

document.write(‘}’);

if (accClickUrl != “”)document.write(‘body > *{cursor: default;}’);

document.write(‘</style>’);

if (accClickUrl != “”){

function OpenWin(page) {

if(accClickTarget==”_blank”)

window.open(page);

else

document.location=page;

}

accBgClickEvent=function(e){var

bglink=accClickUrl;EE=e?e:event;if(!EE)return;var

tg=EE.target?EE.target:EE.srcElement;if((!tg||tg.tagName!=”BODY”)&&tg.parentNode

.tagName!=”BODY”)return;var BackLink=OpenWin(“”+bglink);};

document.onclick= accBgClickEvent;

}

document.write(”);

document.write(”);

</script>

 

Note: This snippet might not work on all sites. Please check with your webmaster to get it working for your site if need be.

29 Comments
  1. Bablu Chakma
    • DFPHelp
  2. Bablu Chakma
    • DFPHelp
  3. Christine
    • DFPHelp
  4. Athanasios
    • DFPHelp
      • Athanasios
  5. Karuppuchamy
    • DFPHelp
  6. Bablu Chakma
  7. Nadeem
    • DFPHelp
  8. Stranger XO
    • DFPHelp
      • Stranger XO
  9. Tabrez
    • DFPHelp
      • Tabrez
  10. zimnerd
    • DFPHelp
  11. Dimitris
    • DFPHelp
  12. Billy
  13. cloud hosting
    • DFPHelp
  14. david stanton
    • DFPHelp

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.