Advertisement
bozghiyy

ta - example

Apr 26th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 9.18 KB | None | 0 0
  1. <html>
  2. <head>
  3.  <meta name="viewport" content="width=device-width, initial-scale=1" />
  4.  
  5. <!-- START of HEAD code -->
  6. <script type="text/javascript">
  7.     var adsStart = (new Date()).getTime();
  8.     function detectWidth() {
  9.         return window.screen.width || window.innerWidth && document.documentElement.clientWidth ? Math.min(window.innerWidth, document.documentElement.clientWidth) : window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
  10.     }
  11.  
  12.     var TIMEOUT = 2000;
  13.  
  14.     var googletag = googletag || {};
  15.     googletag.cmd = googletag.cmd || [];
  16.     var pbjs = pbjs || {};
  17.     pbjs.que = pbjs.que || [];
  18.     var adUnits = adUnits || [];
  19.  
  20.     function initAdServer() {
  21.         if (pbjs.initAdserverSet) return;
  22.         (function() {
  23.             var gads = document.createElement('script');
  24.             gads.async = true;
  25.             gads.type = 'text/javascript';
  26.             var useSSL = 'https:' == document.location.protocol;
  27.             gads.src = (useSSL ? 'https:' : 'http:') +
  28.                 '//www.googletagservices.com/tag/js/gpt.js';
  29.             var node = document.getElementsByTagName('script')[0];
  30.             node.parentNode.insertBefore(gads, node);
  31.         })();
  32.         pbjs.initAdserverSet = true;
  33.     };
  34.     pbjs.timeout = setTimeout(initAdServer, TIMEOUT);
  35.     pbjs.timeStart = adsStart;
  36.  
  37.     var dfpNetwork = '117607917';
  38. </script>  
  39. <!-- START of Adunit Definition -->  
  40. <script type="text/javascript">
  41. if(detectWidth()>=767) {
  42.     /*
  43.     ** Adunits for Desktop
  44.     */
  45.     adUnits.push({
  46.         network: dfpNetwork,
  47.         adunit: 'TA_G_1',
  48.         size: [[300, 250], [300, 410], [336, 280]],
  49.         code: 'div-gpt-ad-1473323524434-0'
  50.     });
  51.     adUnits.push({
  52.         network: dfpNetwork,
  53.         adunit: 'TA_G_2',
  54.         size: [[300, 250], [300, 410], [336, 280],[400,300]],
  55.         code: 'div-gpt-ad-1473323524434-1'
  56.     });
  57.     adUnits.push({
  58.         network: dfpNetwork,
  59.         adunit: 'TA_G_3',
  60.         size: [[300, 250], [300, 410], [336, 280]],
  61.         code: 'div-gpt-ad-1473323524434-2'
  62.     });
  63.     adUnits.push({
  64.         network: dfpNetwork,
  65.         adunit: 'TA_G1_ATF_728V',
  66.         size: [[728, 90], [728, 250], [970, 90], [970, 250]],
  67.         code: 'div-gpt-ad-1460211993436-1'
  68.     });
  69.     adUnits.push({
  70.         network: dfpNetwork,
  71.         adunit: 'TA_G1_ATF_300V',
  72.         size: [[300, 250],[300, 600]],
  73.         code: 'div-gpt-ad-1460211993436-0'
  74.     });  
  75.     adUnits.push({
  76.         network: dfpNetwork,
  77.         adunit: 'TA_G1_BTF1_300V',
  78.         size: [[300, 250],[300, 600]],
  79.         code: 'div-gpt-ad-1460211993436-3'
  80.     });
  81.     adUnits.push({
  82.         network: dfpNetwork,
  83.         adunit: 'TA_G1_BTF1_728V',
  84.         size: [[728, 90]],
  85.         code: 'div-gpt-ad-1473323524445-0'
  86.     });
  87.     adUnits.push({
  88.         network: dfpNetwork,
  89.         adunit: 'TA_G1_BTF2_728V',
  90.         size: [[728, 90]],
  91.         code: 'div-gpt-ad-1473323524445-1'
  92.     });
  93.     adUnits.push({
  94.         network: dfpNetwork,
  95.         adunit: 'TA_G1_BTF3_728V',
  96.         size: [[728, 90]],
  97.         code: 'div-gpt-ad-1473323524445-2'
  98.     });
  99. } else {
  100.     /*
  101.     ** Adunits for Mobile
  102.     */
  103.     adUnits.push({
  104.         network: dfpNetwork,
  105.         adunit: 'TA_MOB_G1_BTF1_300x250',
  106.         size: [[300, 250]],
  107.         code: 'div-gpt-ad-1460532140781-1'
  108.     });  
  109.     adUnits.push({
  110.         network: dfpNetwork,
  111.         adunit: 'TA_MOB_G1_BTF2_300x250',
  112.         size: [[300, 250]],
  113.         code: 'ad_root_btf2_dfp1'
  114.     });
  115.     adUnits.push({
  116.         network: dfpNetwork,
  117.         adunit: 'TA_MOB_G1_BTF3_300x250',
  118.         size: [[300, 250]],
  119.         code: 'ad_root_ac_dfp1'
  120.     });
  121.     adUnits.push({
  122.         network: dfpNetwork,
  123.         adunit: 'TA_MOB_G1_BTF4_300x250',
  124.         size: [[300, 250]],
  125.         code: 'div-gpt-ad-1461661497074-0'
  126.     });
  127.     adUnits.push({
  128.         network: dfpNetwork,
  129.         adunit: 'TA_MOB_G1_BTF5_300x250',
  130.         size: [[300, 250]],
  131.         code: 'div-gpt-ad-1461661958160-0'
  132.     });    
  133. }
  134. </script>
  135. <!-- START of Adunit Definition -->  
  136.  
  137.  
  138. <script type="text/javascript">
  139.     googletag.cmd.push(function() {
  140.       if(adUnits){
  141.         for (var i = 0, len = adUnits.length; i < len; i++) {
  142.          googletag.defineSlot('/'+adUnits[i].network+'/'+adUnits[i].adunit, adUnits[i].size, adUnits[i].code).addService(googletag.pubads());
  143.        }
  144.      }
  145.    });
  146.    googletag.cmd.push(function() {
  147.        pbjs.que.push(function() {pbjs.setTargetingForGPTAsync();});
  148.        googletag.pubads().enableSingleRequest();
  149.        googletag.enableServices();
  150.    });
  151. </script>
  152. <script type="text/javascript" async="true" src="//hb.adapex.io/aaw.ta.g.js"></script>
  153. <!-- START of HEAD code -->
  154. </head>
  155.  
  156. <body>
  157.  
  158.  
  159.  
  160. <!-- BODY codes -->
  161.  
  162.  
  163. <!--TA_G_1 (Desktop) -->
  164. <div id='div-gpt-ad-1473323524434-0'>
  165. <script type='text/javascript'>
  166. if(detectWidth()>=767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1473323524434-0'); });}
  167. else {document.getElementById('div-gpt-ad-1473323524434-0').style.display = 'none';}
  168. </script>
  169. </div>
  170.  
  171. <!--TA_G_2 (Desktop) -->
  172. <div id='div-gpt-ad-1473323524434-1'>
  173. <script type='text/javascript'>
  174. if(detectWidth()>=767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1473323524434-1'); });}
  175. else {document.getElementById('div-gpt-ad-1473323524434-1').style.display = 'none';}
  176. </script>
  177. </div>
  178.  
  179. <!--TA_G_3 (Desktop) -->
  180. <div id='div-gpt-ad-1473323524434-2'>
  181. <script type='text/javascript'>
  182. if(detectWidth()>=767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1473323524434-2'); });}
  183. else {document.getElementById('div-gpt-ad-1473323524434-2').style.display = 'none';}
  184. </script>
  185. </div>
  186.  
  187. <!--TA_G1_ATF_728V (Desktop) -->
  188. <div id='div-gpt-ad-1460211993436-1'>
  189. <script type='text/javascript'>
  190. if(detectWidth()>=767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460211993436-1'); });}
  191. else {document.getElementById('div-gpt-ad-1460211993436-1').style.display = 'none';}
  192. </script>
  193. </div>
  194.  
  195. <!--TA_G1_ATF_300V (Desktop) -->
  196. <div id='div-gpt-ad-1460211993436-0'>
  197. <script type='text/javascript'>
  198. if(detectWidth()>=767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460211993436-0'); });}
  199. else {document.getElementById('div-gpt-ad-1460211993436-0').style.display = 'none';}
  200. </script>
  201. </div>
  202.  
  203. <!--TA_G1_BTF1_300V (Desktop) -->
  204. <div id='div-gpt-ad-1460211993436-3'>
  205. <script type='text/javascript'>
  206. if(detectWidth()>=767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460211993436-3'); });}
  207. else {document.getElementById('div-gpt-ad-1460211993436-3').style.display = 'none';}
  208. </script>
  209. </div>
  210.  
  211. <!--TA_G1_BTF1_728V (Desktop) -->
  212. <div id='div-gpt-ad-1473323524445-0'>
  213. <script type='text/javascript'>
  214. if(detectWidth()>=767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1473323524445-0'); });}
  215. else {document.getElementById('div-gpt-ad-1473323524445-0').style.display = 'none';}
  216. </script>
  217. </div>
  218.  
  219. <!--TA_G1_BTF2_728V (Desktop) -->
  220. <div id='div-gpt-ad-1473323524445-1'>
  221. <script type='text/javascript'>
  222. if(detectWidth()>=767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1473323524445-1'); });}
  223. else {document.getElementById('div-gpt-ad-1473323524445-1').style.display = 'none';}
  224. </script>
  225. </div>
  226.  
  227. <!--TA_G1_BTF3_728V (Desktop) -->
  228. <div id='div-gpt-ad-1473323524445-2'>
  229. <script type='text/javascript'>
  230. if(detectWidth()>=767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1473323524445-2'); });}
  231. else {document.getElementById('div-gpt-ad-1473323524445-2').style.display = 'none';}
  232. </script>
  233. </div>
  234.  
  235. <!--TA_MOB_G1_BTF1_300x250 (Mobile) -->
  236. <div id='div-gpt-ad-1460532140781-1'>
  237. <script type='text/javascript'>
  238. if(detectWidth()<767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460532140781-1'); });}
  239. else {document.getElementById('div-gpt-ad-1460532140781-1').style.display = 'none';}
  240. </script>
  241. </div>
  242.  
  243. <!--TA_MOB_G1_BTF2_300x250 (Mobile) -->
  244. <div id='ad_root_btf2_dfp1'>
  245. <script type='text/javascript'>
  246. if(detectWidth()<767) {googletag.cmd.push(function() { googletag.display('ad_root_btf2_dfp1'); });}
  247. else {document.getElementById('ad_root_btf2_dfp1').style.display = 'none';}
  248. </script>
  249. </div>
  250.  
  251. <!--TA_MOB_G1_BTF3_300x250 (Mobile) -->
  252. <div id='ad_root_ac_dfp1'>
  253. <script type='text/javascript'>
  254. if(detectWidth()<767) {googletag.cmd.push(function() { googletag.display('ad_root_ac_dfp1'); });}
  255. else {document.getElementById('ad_root_ac_dfp1').style.display = 'none';}
  256. </script>
  257. </div>
  258.  
  259. <!--TA_MOB_G1_BTF4_300x250 (Mobile) -->
  260. <div id='div-gpt-ad-1461661497074-0'>
  261. <script type='text/javascript'>
  262. if(detectWidth()<767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1461661497074-0'); });}
  263. else {document.getElementById('div-gpt-ad-1461661497074-0').style.display = 'none';}
  264. </script>
  265. </div>
  266.  
  267. <!--TA_MOB_G1_BTF5_300x250 (Mobile) -->
  268. <div id='div-gpt-ad-1461661958160-0'>
  269. <script type='text/javascript'>
  270. if(detectWidth()<767) {googletag.cmd.push(function() { googletag.display('div-gpt-ad-1461661958160-0'); });}
  271. else {document.getElementById('div-gpt-ad-1461661958160-0').style.display = 'none';}
  272. </script>
  273. </div>
  274.  
  275. </body>
  276. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement