WARNING: This is an Advanced Topic and meant for programmers 

If your site has infinite scroll, is a SPA (Single Page App), PWA (Progressive Web App), or using other forms of AJAX to dynamically load content after the DOM is initially loaded and ready, then the Script Wrapper by default will not scan for new Content Hints.

What you're going to need to do if you insert content hints after the DOM is ready is let the script wrapper know it needs to scan for new content hints.

You can do this via the exposed JavaScript function we provide:

$mediavine.web.fillContentHints();


After you insert the new content and content hints, you simply run that function and the Script Wrapper will automatically look for any new or previous unfilled content hints and fill them with ads.

You can read more about Content Hints, but they are locations in your content you want a content ad to appear.  By running this command, it will look for any new or unfilled content hints. 

That's either <div class='content_hint'></div> or our device specific content hints:

Mobile Only:

<div class="content_mobile_hint"></div>

Desktop Only:

<div class="content_desktop_hint"></div>

If you call this function multiple times, that is okay. It won't refill existing content hints again.

If you register a new page view, the system will be smart enough to detect a change in the URL and there is no need to indicate to the Script Wrapper.

If you're using AJAX to load a new content area that you need new dynamic in-content ads run in, such as a loading a new blog post, then you'll need to use a different callback. For that we have our dynamic insert content ads callback. Please consult that help article.
 

Did this answer your question?