Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Browsi API is a set up method for those who would like to implement Browsi and use current ad placements that will be optimised based on our machine learning software.

Steps

  1. Copy / Paste the code snippet at the highest position within the <head> section of the pages on your website. This snippet needs to be inserted after the Browsi Tag from the first implementation step.

<!-- Script #1 -->
<!-- The following script loads the Browsi Engine A.I -->
<scriptsrc="https://cdn.browsiprod.com/bootstrap/bootstrap.js"
id="browsi-tag" data-pubKey="pubkey" data-siteKey="sitekey"
async></script>
!-- Script #2 --><
<script>
  window.browsitag = window.browsitag || {};  
window.browsitag.cmd = window.browsitag.cmd || [];
</script>

2. Remove googletag.defineSlot for Browsi managed slots:

  • div-gpt-ad-mobilearticle-1-5

  • Browsi will apply its smart configuration and define the slots in order to deliver a highly viewable ad layout.

3. Find and replace all mentioned placements that are on the article pages and replace them with Browsi Placement API tags.Every setup is done differently - please treat this as an example only

 

<div id="div-gpt-ad-mobilearticle-1">
    <script>
      googletag.cmd.push(function() {
          googletag.display('div-gpt-ad-mobilearticle-1');
      });    </script
</div>
Replace it with - Browsi Placement API
<div id="div-gpt-ad-mobilearticle-1">
      <script>
      window.browsitag.cmd.push(() => {
      window.browsitag.display("div-gpt-ad-mobilearticle-1", {
          sizes:[{w:320,h:480},{w:300,h:250},{w:300,h:600}],
          adUnit: "/21675937462/upday_website/upday_mobile/upday_mobile_articlepage",      disableViewabilityOptimization: false ,
          positionTag: "in-content" //can also be: ‘bottom',’in-content', ‘adhesive', ‘left-rail’, 'right-rail’
      });
      });
    </script>
  </div>

Code Block
<body>
  <div id="<DIV_ID>">
    <script>
      window.browsitag.cmd.push(() => {
       window.browsitag.display("<DIV_ID>", {
          sizes: [  {w:300,h:600},{w:300,h: 250},"fluid" ],
          adUnit: "AD_UNIT",
          disableViewabilityOptimization: false ,
          positionTag: 'top'           //can be also: 'bottom','in-content','adhesive','left-rail', 'right-rail'
        });
      });
    </script>
  </div>
</body>

API Parameters

parameter

description

type

required

example

div_id

Element id; must be a single unique id per slot on the page; unit id and element id need to be the same.

string

Yes

“div-gpt-ad-12345”

adUnit

Google Ad Manager ad unit to call, including the publisher id and leading “/”. 

When left empty we will use the default configured ad unit on the Browsi platform.

string

Yes

adUnit: "/1234456/browsi/ad/unit"

Sizes

A list of all sizes for this specific ad placement.

Format - {w:XXX, h:XXX} (Width x Height). For Fluid ad size - 'fluid'.

array of objects

Yes

Code Block
sizes: [
 {w:300,h:600},
 {w:300,h: 250}, "fluid"
]

positionTag

Communicates the position of the ad element/unit to be served. The position tag can be from the following options: top, bottom, in-content(in-line), adhesive, rail-left and rail-right.

string

Yes

positionTag:'top'