Advertisement
bozghiyy

TA - JS get page from URL

Mar 29th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // take second to last char from the url
  2. if(parseInt(window.location.href.substr(-2,1)) > 2) {
  3. // Page number >2
  4. googletag.defineSlot('/117607917/TA_G1_ATF_300V', [[300, 250],[300, 600]], 'div-gpt-ad-1460211993436-0').addService(googletag.pubads());
  5. googletag.defineSlot('/117607917/TA_G1_BTF1_300V', [[300, 250],[300, 600]], 'div-gpt-ad-1460211993436-3').addService(googletag.pubads());
  6.  
  7. } else {
  8. // Page number <= 2
  9. googletag.defineSlot('/117607917/TA_G1_ATF_300V', [[300, 250]], 'div-gpt-ad-1460211993436-0').addService(googletag.pubads());
  10. googletag.defineSlot('/117607917/TA_G1_BTF1_300V', [[300, 250]], 'div-gpt-ad-1460211993436-3').addService(googletag.pubads());
  11.  
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement