How can i set a delay to my popunder ad code?

Hello,

I just want to set a delay to my pop under code. can anyone help me with this?

the code is like;

<script type=\"text/javascript\">
  var _pop = _pop || [];
  _pop.push(['siteId', xxxxxx]);
  _pop.push(['minBid', 0]);
  _pop.push(['popundersPerIP', 2]);
  _pop.push(['delayBetween', 5]);
  _pop.push(['default', false]);
  _pop.push(['defaultPerDay', 0]);
  _pop.push(['topmostLayer', false]);
  (function() {
    var pa = document.createElement('script'); pa.type = 'text/javascript'; pa.async = true;
    var s = document.getElementsByTagName('script')[0]; 
    pa.src = '//companyurl.js';
    pa.onerror = function() {
      var sa = document.createElement('script'); sa.type = 'text/javascript'; sa.async = true;
      sa.src = '//companyurl.js';
      s.parentNode.insertBefore(sa, s);
    };
    s.parentNode.insertBefore(pa, s);
  })();
</script>

thanks a lot for the support.

window.setTimeout

Pop unders are a guaranteed way to get most users to turn on their adblock script against your site and/or disable javascript on your pages, if they succeed at all. Browsers ship with pop up blockers for a reason, users find them incredibly obnoxious and rude. You will do more harm to your brand with this technique than help.

3 Likes

window.setTimeout is used like this:

function obnoxiousPopunder() {
    // code here
}
window.setTimeout(obnoxiousPopunder, 3000);

Be warned though, that people are much more likely to abandon your site and find information from elsewhere when you use such techniques.

1 Like

I totally agree with @Michael_Morris and @Paul_Wilkins on this one. I was going to reply, earlier, stating that such an underhanded action doesn’t deserve help, but I think Michael and Paul have provided the best response.

Just say “NO” to pop-unders.

:slight_smile:

While that’s my knee jerk response as well, we don’t know if the OP has already urged the client not to do this and has given up and is going ahead with it just to placate them. In that event we’d just be preaching to the choir. Since what he wants to do is ultimately not harmful to someone else’s machine (just hella annoying) I provided the how of it.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.