GuidesAd ServingJS Tag for Web

JS Tag for Web

The JavaScript tag is the simplest way to add Praevis ads to a web page. Drop in one script tag and it handles the auction, rendering, and viewability tracking.

Basic Tag

<script src="https://rtb.praevis.com/tag.js?publisher_id={id}&w=728&h=90"></script>

Replace {id} with your publisher ID.

Parameters

ParameterDescriptionExample
publisher_idYour publisher IDpub_abc123
wAd width in pixels728
hAd height in pixels90
formatAd format (optional)banner (default)

How It Works

  1. The script creates an iframe at the tag’s location on the page
  2. An auction runs at the nearest edge location (sub-5ms)
  3. The winning creative renders inside the iframe
  4. Viewability tracking starts via IntersectionObserver
  5. Impression pixel fires when the ad is in view

If no DSP bids, the iframe remains empty (no layout shift).

Common Sizes

SizeUse Case
728x90Leaderboard
300x250Medium rectangle
160x600Wide skyscraper
320x50Mobile banner
300x600Half page
970x250Billboard

Viewability Tracking

The tag uses the browser’s IntersectionObserver API to track whether the ad is actually visible on screen. An impression is only counted when:

  • At least 50% of the ad is in the viewport
  • The ad has been visible for at least 1 second (display) or 2 seconds (video)

This follows IAB viewability standards.

Example: Full Page Integration

<!-- Leaderboard at top of page -->
<div class="ad-slot">
  <script src="https://rtb.praevis.com/tag.js?publisher_id=pub_abc123&w=728&h=90"></script>
</div>
 
<!-- Content here -->
 
<!-- Medium rectangle in sidebar -->
<div class="ad-slot">
  <script src="https://rtb.praevis.com/tag.js?publisher_id=pub_abc123&w=300&h=250"></script>
</div>

Tips

  • Place the tag inside a container div that matches the ad dimensions to prevent layout shift.
  • Multiple tags on one page run independent auctions. Each tag fills separately.
  • The tag loads asynchronously and does not block page rendering.