1.1.1 • Published 1 year ago

@nextdaymedia/oneline v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

OneLine

Welcome by the Next Day Media OneLine project. The OneLine handles all the logic needed for a publisher to serve ads.

Stub

In head code:

<script async src="//oneline.nextday.media/static/tags/XXXXXXXXXX.js"></script>

Event listeners

OneLine offers external script the possibility to receive events. You can subscribe to topics to add custom behaviour.

Topics

You can subscribe to the following topics:

TopicDescriptionData
isEmptyWhen the placement has no ad to display{id: <id of the ad div>}
isNotEmptyWhen the placement has an ad to display{id: <id of the ad div>}
tcfReadyWhen tcf is ready-
documentReadyWhen documentReady is ready-
ageGateReadyWhen ageGateReady is ready-

Subscribe example isEmpty (add div)

ndmOne.event.subscribe(ndmOne.event.topic.isEmpty, (data) => {
  console.log("Event isEmpty : ", data);
  if (data.id !== "ndm-predefined-1") {
    return;
  }
  let e = document.getElementById(data.id);
  let n = document.createElement("div");
  n.innerHTML = "Event: isEmpty";
  e.parentNode.insertBefore(n, e.nextSibling);
});

Control ad unit

If the rendering of the view is completed. You can request the ad units.

import { NdmOne } from "@nextdaymedia/oneline";

declare const ndmOne: NdmOne;

  ndmOne.adUnitRequest(); // Set command to load all matching ad units on the page
  // ndmOne.adUnitRequest(['ndm-1', 'ndm-2']); // Or load only this div's
  // ndmOne.adUnitRequest(['push-up-all']); // Or load only all push up's
1.1.1

1 year ago

1.1.0

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago