InLine unit

Integration steps

  1. Create an account on and add your site
  2. Copy the InLine unit tag from the publisher dashboard
  3. Paste the tag where you want the unit to appear on the page OR insert the tag into your ad server and copy/paste your ad server’s tag where you want the ad to appear (see FAQs below)
  4. If hard-coding the tag on your page or using DFP, follow "widget_anchor" instructions below to place the tag at the bottom of the page and the anchor where you want the ad to appear.

Custom parameters

InLine supports all regular widget parameters at, plus some specific to this unit (below):

Param Type Details
widget_anchor String CSS selector pointing to element on page after which widget will be inserted. Without it widget will be inserted right after SCRIPT tag of InLine unit. Should be URL-encoded. See FAQs below.
widget_position String Which position widget should be placed to according to anchor element. Possible values are before, after, append, prepend. Default is after.
dfp_view String URL to track DFP view. Designed to use with DFP Macros. Should be URL-encoded.
negative_anchor String CSS selector pointing to element on page. Use this to prevent widget from appearing if a specific element is present on the page. Should be URL-encoded.
iframe_id String Can be used to specify an ID of widget iFrame. This ID then can be used to get widget element. Use only letters, numbers and - symbol.


Basic tag

<script type='text/javascript' src='//'></script>

Tag with custom widget anchor

<div id='some-section'>
Element on your page where the widget will be placed right after. 
<script type='text/javascript' src='//'></script>

In this example, the unit will be inserted right after the DIV element with CSS selector #some-section

"No-Ad" Callback

This snippet must be hardcoded on the page where the widget is present.

    window.onViroolInlineNoAds = function (wid) {
      console.log("no ads in unit: " + wid);
      // Please add logic here to call another demand partner

In this example, unit will execute callback function onViroolInlineNoAds if Virool network has nothing to offer to current site visitor. This no-ad callback will not work if you copy and paste it into DFP.

Using with DFP macros

Some sites may want to track our tag insertions with DFP macros. To do so, add &dfp_view=%%VIEW_URL_ESC%% to script tag SRC parameters. This will add a corresponding pixel to page on widget load. For more info click here.

<script type='text/javascript' src='//'></script>


How can I serve the InLine via an ad server (e.g. DFP)?

Create a new ad unit in DFP (Google Publisher Tag) called "Out-of-page unit" to serve non-standard ads. Copy/paste the InLine player tag into your ad server, trafficking the player tag as a creative. Create a JavaScript tag (not iFrame tag) for the placement you trafficked the InLine creative to, and place your ad server's tag onto the page where you want the ad to appear.

How should I implement the widget_anchor?

The widget anchor allows publishers to denote where they would like the InLine widget to appear. The value of the widget anchor should be URL-encoded. Please note: if you are using DFP, please make sure the CSS element (i.e. div id="some-section") is outside of the DFP tag, as our widget will not be able to find it within the DFP iFrame.

Some examples:

// InLine unit rendering after div ID "virool" - please note, "#" must be URL-encoded
// widget_anchor=%23virool

<div id="virool"></div>
// InLine unit rendering after div class "virool"
// widget_anchor=.virool

<div class="virool"></div>
// InLine unit rendering after 2nd paragraph element in div id "virool"
// widget_anchor=%23virool%20p%3Anth(1)
// unencoded value: #virool p:nth(1)

<div id="virool">
    <p>Paragraph 1</p>
    <p>Paragraph 2</p>
    <p>Paragraph 3</p>

Can I place the unit in an iFrame?

No, the unit should be placed directly on the host page. Placing the unit within an iFrame is not possible as it changes its behavior and dynamic functionality.

Where is the best spot to place the tag?

If placed in-text (e.g. in-article), our recommendation is to place the unit after the second paragraph. Since an impression is counted when the area comes into view, we do not recommend placing the unit far below the fold.

What happens if there are no campaigns available for the viewer?

If an ad call is made and no campaign is returned, the tag lives invisibly on the page, and the widget will not expand within the text. The page content is unaffected, and the user is none the wiser.

What is the size of the unit?

InLine is customizable in size by modifying the width/height parameters in the tag (recommended size is 640x400 or 640x360). The unit must occupy the full width of the text/content section on your site, and must be larger than 450 pixels in width for the placement to be approved.

Can the unit be closed once it loads on a page?

Yes, the close button loads immediately at the top right.

Can the unit be added to a page that already has a video?

We don't recommend that adding the unit on pages with video content, in the interest of user experience. Use the negative_anchor parameter above to stop the unit from loading on pages that already have a video.