Logo

What are you looking for?

Get help straight from our team...

How can I prevent an interstitial ad unit from showing in a section?

General Questions

How can I prevent an interstitial ad unit from showing in a section?

Last updated on 25 Nov, 2025

It is possible to prevent specific links from triggering interstitials by adding a "data-google-interstitial="false"" attribute to the anchor element or any ancestor of the anchor element.

 

The code is:

<a data-google-interstitial="false" href="https://sulvo.com/"> This link will never trigger an interstitial </a>

 

You can do this for an entire section using the following:

// None of the links within this div will trigger interstitials.
<div data-google-interstitial="false">
  <div>
    <a href="...">Link 1</a>
  </div>
  <a href="...">Link 2</a>
</div>

 

You also have the option to prevent interstitials from showing in subdirectories placing the following in the header:

<script>
var blacklist=["/subdirectory1/","/subdirectory2/","/subdirectory3/"]
window.document.addEventListener('DOMContentLoaded', function(){
    var linksHrefs = document.querySelectorAll('a')
    for (var i = 0; i < linksHrefs.length; ++i) {
      var tag = linksHrefs[i]
      if(blacklist.some(function (b) { return tag.href.includes(b) }) {
            tag.setAttribute('data-google-interstitial','false')
        }
    }
})
</script>

 

 

Did you find this article helpful?
Previous

What is an Ad Tag?

Next