Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Anatomy of an online ad: Google ad delivery script
document.write('\x3c!-- Template Id \x3d 13,901 Template Name \x3d Banner Creative (Flash) - In Page Multiples - [DFA] --\x3e\n\x3c!-- Copyright 2006 DoubleClick Inc., All rights reserved. --\x3e\x3cscript src\x3d\x22http://s0.2mdn.net/879366/flashwrite_1_2.js\x22\x3e\x3c/script\x3e\n\x3cSCRIPT LANGUAGE\x3d\x22JavaScript\x22\x3e\n\x3c!--\nfunction DCFlash(id,pVM){\nvar swf \x3d \x22http://s0.2mdn.net/877848/CLB012__Hiking_728x90.swf\x22;\nvar gif \x3d \x22http://s0.2mdn.net/877848/Celebrex_728x90_Unbranded_Backup.3.11.13_1.gif\x22;\nvar minV \x3d 8;\nvar FWH \x3d \x27 width\x3d\x22728\x22 height\x3d\x2290\x22 \x27;\nvar url \x3d escape(\x22http://adclick.g.doubleclick.net/aclk?sa\x3dL\x26ai\x3dBkkTr1ABuUYnfKOz56AHh_4HQCbOj0YsDAAAAEAEgADgAUIC6g9b______wFYs4bGy0xgyYb2iISk7A-CARdjYS1wdWItNjc2MDQyMjg4NTEzMDEyMrIBGHd3dy5kY2xrLWRlZmF1bHQtcmVmLmNvbboBCWdmcF9pbWFnZcgBCdoBIGh0dHA6Ly93d3cuZGNsay1kZWZhdWx0LXJlZi5jb20vmAKIpAHAAgLgAgDqAi00Nzg4L2huLnVzLmhtbnloLmRpci54LngueC9DZWxlYnJleF9BcnRocml0aXP4AoHSHpAD4AOYA-ADqAMB4AQBoAYe\x26num\x3d0\x26sig\x3dAOD64_2y2kW7wNSq8iMKhxr0rN1gC3lDFA\x26client\x3dca-pub-6760422885130122\x26adurl\x3dhttp%3A%2F%2Fad.doubleclick.net/click%3Bh%3Dv8/3dc7/3/0/%2a/v%3B266113741%3B3-0%3B0%3B92295057%3B3454-728/90%3B53480227/53398896/1%3B%3B%7Esscs%3D%3fhttp://www.celebrex.com/default.aspx?o\x3d92295057|266113741|53480227\x22);\nvar wmode \x3d \x22opaque\x22;\nvar bg \x3d \x22same as SWF\x22;\nvar dcallowscriptaccess \x3d \x22never\x22;\n\nvar openWindow \x3d \x22false\x22;\nvar winW \x3d 600;\nvar winH \x3d 400;\nvar winL \x3d 0;\nvar winT \x3d 0;\n\nvar moviePath\x3dswf.substring(0,swf.lastIndexOf(\x22/\x22));\nvar sm\x3dnew Array();\nsm[1] \x3d \x22\x22;\nsm[2] \x3d \x22\x22;\nsm[3] \x3d \x22\x22;\nsm[4] \x3d \x22\x22;\nsm[5] \x3d \x22\x22;\n\nvar ct\x3dnew Array();\nct[0]\x3d\x22\x22;if(ct[0].substr(0,4)!\x3d\x22http\x22){ct[0]\x3d\x22\x22;} \nct[1] \x3d \x22http://www.celebrex.com/default.aspx?cmp\x3dCLXHAFL\x26o\x3d92295057|266113741|53480227\x22;\nct[2] \x3d \x22http://pfizer.com/files/products/uspi_celebrex.pdf\x22;\nct[3] \x3d \x22http://media.pfizer.com/files/products/mg_celebrex.pdf\x22;\nct[4] \x3d \x22http://www.celebrex.com/isi.aspx?cmp\x3dCLXHAFL\x26o\x3d92295057|266113741|53480227\x22;\nct[5] \x3d \x22http://www.celebrex.com/default.aspx?cmp\x3dCLXHAFL\x26o\x3d92295057|266113741|53480227\x22;\nct[6] \x3d \x22\x22;\nct[7] \x3d \x22\x22;\nct[8] \x3d \x22\x22;\nct[9] \x3d \x22\x22;\nct[10] \x3d \x22\x22;\n\nvar fv\x3d\x27\x22clickTag\x3d\x27+url+\x27\x26clickTAG\x3d\x27+url+\x27\x26clicktag\x3d\x27+url+\x27\x26moviePath\x3d\x27+moviePath+\x27/\x27+\x27\x26moviepath\x3d\x27+moviePath+\x27/\x27;\nfor(i\x3d1;i\x3csm.length;i++){if(sm[i]!\x3d\x22\x22){fv+\x3d\x22\x26submovie\x22+i+\x22\x3d\x22+escape(sm[i]);}}\nfor(i\x3d1;i\x3cct.length;i++){if(ct[i]!\x3d\x22\x22){if(ct[i].indexOf(\x22http\x22)\x3d\x3d0){x\x3descape(\x22http://adclick.g.doubleclick.net/aclk?sa\x3dL\x26ai\x3dBkkTr1ABuUYnfKOz56AHh_4HQCbOj0YsDAAAAEAEgADgAUIC6g9b______wFYs4bGy0xgyYb2iISk7A-CARdjYS1wdWItNjc2MDQyMjg4NTEzMDEyMrIBGHd3dy5kY2xrLWRlZmF1bHQtcmVmLmNvbboBCWdmcF9pbWFnZcgBCdoBIGh0dHA6Ly93d3cuZGNsay1kZWZhdWx0LXJlZi5jb20vmAKIpAHAAgLgAgDqAi00Nzg4L2huLnVzLmhtbnloLmRpci54LngueC9DZWxlYnJleF9BcnRocml0aXP4AoHSHpAD4AOYA-ADqAMB4AQBoAYe\x26num\x3d0\x26sig\x3dAOD64_2y2kW7wNSq8iMKhxr0rN1gC3lDFA\x26client\x3dca-pub-6760422885130122\x26adurl\x3dhttp%3A%2F%2Fad.doubleclick.net/click%3Bh%3Dv8/3dc7/3/0/%2a/v%3B266113741%3B3-0%3B0%3B92295057%3B3454-728/90%3B53480227/53398896/1%3B%3B%7Esscs%3D%3f\x22+ct[i]);}else{x\x3descape(ct[i]);}fv+\x3d\x22\x26clickTag\x22+i+\x22\x3d\x22+x+\x22\x26clickTAG\x22+i+\x22\x3d\x22+x+\x22\x26clicktag\x22+i+\x22\x3d\x22+x;}}\nfv+\x3d\x27\x22\x27;\nvar bgo\x3d(bg\x3d\x3d\x22same as SWF\x22)?\x22\x22:\x27\x3cparam name\x3d\x22bgcolor\x22 value\x3d\x22#\x27+bg+\x27\x22\x3e\x27;\nvar bge\x3d(bg\x3d\x3d\x22same as SWF\x22)?\x22\x22:\x27 bgcolor\x3d\x22#\x27+bg+\x27\x22\x27;\nfunction FSWin(){if((openWindow\x3d\x3d\x22false\x22)\x26\x26(id\x3d\x3d\x22DCF0\x22))alert(\x27openWindow is wrong.\x27);if((openWindow\x3d\x3d\x22center\x22)\x26\x26window.screen){winL\x3dMath.floor((screen.availWidth-winW)/2);winT\x3dMath.floor((screen.availHeight-winH)/2);}window.open(unescape(url),id,\x22width\x3d\x22+winW+\x22,height\x3d\x22+winH+\x22,top\x3d\x22+winT+\x22,left\x3d\x22+winL+\x22,status\x3dno,toolbar\x3dno,menubar\x3dno,location\x3dno\x22);}this.FSWin \x3d FSWin;\nua\x3dnavigator.userAgent;\nif(minV\x3c\x3dpVM\x26\x26(openWindow\x3d\x3d\x22false\x22||(ua.indexOf(\x22Mac\x22)\x3c0\x26\x26ua.indexOf(\x22Opera\x22)\x3c0))){\n\tvar adcode\x3d\x27\x3cobject classid\x3d\x22clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\x22 id\x3d\x22\x27+id+\x27\x22\x27+FWH+\x27\x3e\x27+\n\t\t\x27\x3cparam name\x3d\x22movie\x22 value\x3d\x22\x27+swf+\x27\x22\x3e\x3cparam name\x3d\x22flashvars\x22 value\x3d\x27+fv+\x27\x3e\x3cparam name\x3d\x22quality\x22 value\x3d\x22high\x22\x3e\x3cparam name\x3d\x22wmode\x22 value\x3d\x22\x27+wmode+\x27\x22\x3e\x3cparam name\x3d\x22base\x22 value\x3d\x22\x27+swf.substring(0,swf.lastIndexOf(\x22/\x22))+\x27\x22\x3e\x3cPARAM NAME\x3d\x22AllowScriptAccess\x22 VALUE\x3d\x22\x27+dcallowscriptaccess+\x27\x22\x3e\x27+bgo+\n\t\t\x27\x3cembed src\x3d\x22\x27+swf+\x27\x22 flashvars\x3d\x27+fv+bge+FWH+\x27 type\x3d\x22application/x-shockwave-flash\x22 quality\x3d\x22high\x22 swliveconnect\x3d\x22true\x22 wmode\x3d\x22\x27+wmode+\x27\x22 name\x3d\x22\x27+id+\x27\x22 base\x3d\x22\x27+swf.substring(0,swf.lastIndexOf(\x22/\x22))+\x27\x22 AllowScriptAccess\x3d\x22\x27+dcallowscriptaccess+\x27\x22\x3e\x3c/embed\x3e\x3c/object\x3e\x27;\n if((\x27x\x27!\x3d\x22j\x22)\x26\x26(typeof dclkFlashWrite!\x3d\x22undefined\x22)){dclkFlashWrite(adcode);}else{document.write(adcode);}\n}else{\n\tdocument.write(\x27\x3ca target\x3d\x22_blank\x22 href\x3d\x22\x27+unescape(url)+\x27\x22\x3e\x3cimg src\x3d\x22\x27+gif+\x27\x22\x27+FWH+\x27border\x3d\x220\x22 alt\x3d\x22\x22 galleryimg\x3d\x22no\x22\x3e\x3c/a\x3e\x27);\n}}\nvar pVM\x3d0;var DCid\x3d(isNaN(\x22266113741\x22))?\x22DCF2\x22:\x22DCF266113741\x22;\nif(navigator.plugins \x26\x26 navigator.mimeTypes.length){\n var x\x3dnavigator.plugins[\x22Shockwave Flash\x22];if(x \x26\x26 x.description){var pVF\x3dx.description;var y\x3dpVF.indexOf(\x22Flash \x22)+6;pVM\x3dpVF.substring(y,pVF.indexOf(\x22.\x22,y));}}\nelse if (window.ActiveXObject \x26\x26 window.execScript){\n window.execScript(\x27on error resume next\\npVM\x3d2\\ndo\\npVM\x3dpVM+1\\nset swControl \x3d CreateObject(\x22ShockwaveFlash.ShockwaveFlash.\x22\x26pVM)\\nloop while Err \x3d 0\\nOn Error Resume Next\\npVM\x3dpVM-1\\nSub \x27+DCid+\x27_FSCommand(ByVal command, ByVal args)\\nCall \x27+DCid+\x27_DoFSCommand(command, args)\\nEnd Sub\\n\x27,\x22VBScript\x22);}\neval(\x22function \x22+DCid+\x22_DoFSCommand(c,a){if(c\x3d\x3d\x27openWindow\x27)o\x22+DCid+\x22.FSWin();}o\x22+DCid+\x22\x3dnew DCFlash(\x27\x22+DCid+\x22\x27,pVM);\x22);\n//--\x3e\n\x3c/SCRIPT\x3e\n\x3cnoscript\x3e\x3ca target\x3d\x22_blank\x22 href\x3d\x22http://adclick.g.doubleclick.net/aclk?sa\x3dL\x26ai\x3dBkkTr1ABuUYnfKOz56AHh_4HQCbOj0YsDAAAAEAEgADgAUIC6g9b______wFYs4bGy0xgyYb2iISk7A-CARdjYS1wdWItNjc2MDQyMjg4NTEzMDEyMrIBGHd3dy5kY2xrLWRlZmF1bHQtcmVmLmNvbboBCWdmcF9pbWFnZcgBCdoBIGh0dHA6Ly93d3cuZGNsay1kZWZhdWx0LXJlZi5jb20vmAKIpAHAAgLgAgDqAi00Nzg4L2huLnVzLmhtbnloLmRpci54LngueC9DZWxlYnJleF9BcnRocml0aXP4AoHSHpAD4AOYA-ADqAMB4AQBoAYe\x26num\x3d0\x26sig\x3dAOD64_2y2kW7wNSq8iMKhxr0rN1gC3lDFA\x26client\x3dca-pub-6760422885130122\x26adurl\x3dhttp%3A%2F%2Fad.doubleclick.net/click%3Bh%3Dv8/3dc7/3/0/%2a/v%3B266113741%3B3-0%3B0%3B92295057%3B3454-728/90%3B53480227/53398896/1%3B%3B%7Esscs%3D%3fhttp://www.celebrex.com/default.aspx?o\x3d92295057|266113741|53480227\x22\x3e\x3cimg src\x3d\x22http://s0.2mdn.net/877848/3-CBX012_GIF1_728x90_L3S.gif\x22 width\x3d\x22728\x22 height\x3d\x2290\x22 border\x3d\x220\x22 alt\x3d\x22\x22 galleryimg\x3d\x22no\x22\x3e\x3c/a\x3e\x3c/noscript\x3e\n\x3cscript type\x3d\x22text/javascript\x22 src\x3d\x22http://secure-us.imrworldwide.com/cgi-bin/m?ci\x3dENT21188\x26am\x3d1\x26mr\x3d1\x26ty\x3djs\x26ep\x3d1\x26at\x3dview\x26rt\x3dbanner\x26st\x3dimage\x26ca\x3dcmp12600\x26cr\x3d53480227\x26pc\x3d92295057\x26r\x3d1028618\x22\x3e\x3c/script\x3e\n\x3cnoscript\x3e\x3cimg src\x3d\x22http://secure-us.imrworldwide.com/cgi-bin/m?ci\x3dENT21188\x26am\x3d1\x26ep\x3d1\x26at\x3dview\x26rt\x3dbanner\x26st\x3dimage\x26ca\x3dcmp12600\x26cr\x3d53480227\x26pc\x3d92295057\x26r\x3d1028618\x22/\x3e\n\x3cimg src\x3d\x22http://pixel.adsafeprotected.com/?anid\x3d5092\x26campid\x3dcmp12600\x26placementid\x3d1_92295057\x26creativeid\x3d53480227\x22/\x3e\x3c/noscript\x3e\n\x3cscript Src\x3d\x22http://cdn.doubleverify.com/dvtp_src.js?ctx\x3d525748\x26cmp\x3d7160975\x26sid\x3d477325\x26plc\x3d92295057\x26num\x3d\x26adid\x3d\x26advid\x3d877848\x26adsrv\x3d1\x26region\x3d30\x26btreg\x3d266113741\x26btadsrv\x3ddoubleclick\x26crt\x3d\x26crtname\x3d\x26chnl\x3d\x26unit\x3d\x26pid\x3d\x26uid\x3d\x26dvtagver\x3d6.1.src\x22 type\x3d\x22text/javascript\x22\x3e\x3c/script\x3e');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.