JavaScript API
Listen for Admiral events and open Admiral views from your page through window.admiral.
Admiral runs on your site as a tag. These pages cover the three APIs you build against it.
// Listen for an Admiral event.
window.admiral("after", "measure.detected", function (state) {
if (state.adblocking) {
document.body.classList.add("adblock-enabled");
}
});
// Open an Admiral view.
window.admiral("show", "transact.subscribe");
Listen for Admiral events and open Admiral views from your page through window.admiral.
Read and write accounts, subscriptions, and first-party data from your server over JSON-RPC.
Serve your property's bootstrap script from your own server instead of pasting a static tag.