Skip to content

BTA Feed

BTA Feed is a ready-to-use feed designed to display below an article. It consists of a set of configurable widgets, typically including Yaleo placement widgets. Ad serving uses Prebid.js with support for multiple ad providers.

Located under Yaleo / BTA Feed: https://app.adconsole.com/yaleo/bta-feed/v2

The publisher adds the BTA Feed script and initialization directly in their page markup.

Include the script tag on the page:

<script async src="https://cdn.adnz.co/bta-feed/index.js"></script>

Initialize the feed:

window.adnzBtaFeed = window.adnzBtaFeed || {};
window.adnzBtaFeed.queue = window.adnzBtaFeed.queue || [];
window.adnzBtaFeed.queue.push(() => {
window.adnzBtaFeed.start({
btaFeedId: '00000000-0000-0000-0000-000000000000',
element: document.getElementById('target-element-id'),
});
});

The integration script is deployed as a Raw JS entry in Headertag.

  1. Assign the BTA Integration Script (Prebid) script from AdConsole / Raw Scripts to the tag. The script defines the setupBtaFeed function:
window.setupBtaFeed = function setupBtaFeed(elementId, btaFeedId, options = {}, isPageReady = () => true) {
function onload() {
const checkElement = setInterval(
() => {
const element = document.getElementById(elementId);
if (element && isPageReady()) {
if (element.dataset.hydrated === '0') {
return;
}
if (window.htag.api) {
window.htag.api('1').clearEffects({ tags: [`waiting-for-element:${elementId}`] });
}
element.dataset.adnzShown = '1';
element.dataset.adnzLoaded = '1';
window.adnzBtaFeed.start({ ...options, element, btaFeedId });
}
},
250,
);
if (window.htag.api) {
window.htag.api('1').saveEffect(
() => {
clearInterval(checkElement);
},
{ tags: [`ad:${elementId}`, `waiting-for-element:${elementId}`] },
);
}
}
if (!window.adnzBtaFeed?.start) {
const script = document.createElement('script');
script.src = 'https://cdn.adnz.co/bta-feed/index.js';
script.async = true;
script.defer = true;
script.onload = onload;
document.head.appendChild(script);
} else {
onload();
}
};
  1. Add a new Raw JS script that calls setupBtaFeed with the target element ID and BTA Feed ID:
setupBtaFeed('target-element-id', '00000000-0000-0000-0000-000000000000');

For publishers with complex or non-standard integration requirements, per-publisher scripts are maintained in js/scripts/bta-feed/. Each script wraps the standard setupBtaFeed call and extends it with publisher-specific logic — for example, resolving the target element via XPath when a stable DOM ID is unavailable, or deferring initialization until a custom lifecycle hook fires.

window.adnzBtaFeed.start() accepts the following options:

ParamTypeDefaultDescription
btaFeedIdstringRequired. The BTA Feed ID.
elementHTMLElementTarget element. If not provided, created next to the script tag.
debugbooleanEnables app-specific debug logging and test mode for ads, and changes Shadow DOM mode to open.
forceMobilebooleanForces mobile configuration.
forceEnabledbooleanForces the feed to be enabled regardless of backend configuration.
forceDarkThemebooleanForces dark theme regardless of OS preference or publisher site detection. Applies dark-theme to the feed container and yaleo-dark-theme to Yaleo placement content.
isDarkThemeSupportedbooleanEnables dark theme detection via the prefers-color-scheme media query. Does not affect publisher-specific custom detector rules. When omitted, enabled only on known dark-theme publisher sites.
iframeModebooleanIndicates that the root element is an iframe child, overriding the default auto-detection. Hides the parent iFrame and renders the BTA Feed container directly below it.
mockRecommendationsbooleanUses mock data instead of real recommendations.
newItemMarkupbooleanfalseUses updated HTML markup for articles and ads.
endlessScrollEnabledbooleanfalseEnables infinite scroll on the last Yaleo placement widget.
lazyLoadingbooleanfalseLoads ads only when the BTA Feed is visible in the viewport.
headerTagUndoEffectEnabledbooleanfalseSaves the cleanup effect to the Header Tag’s undo effect stack.
isDisabled() => boolean() => falseReturns true to disable the feed, e.g. based on user language.
brandingTagLocationBrandingTagLocationPLACEMENT_CONTAINERWhere to display the branding tag.
urlstring | nullOverrides the page URL used for targeting and analytics.
forceXandrCreativeIdnumberForces all native ads to use a specific Xandr creative ID. Disables non-Xandr bidders when set.
containerAttributesDataAttributesData attributes for the BTA section container element.
containerClassNameClassnamesArgumentCSS class name(s) for the container element.
widgetListClassNameClassnamesArgumentCSS class name(s) for the widget list container.
yaleoPlacementContentClassNameClassnamesArgumentCSS class name(s) for Yaleo placement widget content containers.
ParamDescription
formatArticleDateFormats article dates.
formatReadingTimeFormats article reading time.
formatRequestParamsModifies request parameters before sending to the server.
formatYaleoPlacementItemsFormats, filters, or sorts Yaleo placement items.
getAdUrlOverrides ad URLs. Useful for mobile app deep links.
getAdAttributesReturns data attributes for ad elements.
getArticleClassNamesReturns custom class names for article elements.
getArticleMetaReturns initial article meta data.
getArticleAttributesReturns data attributes for article elements.
getArticleUrlOverrides article URLs. Useful for mobile app deep links.
getWidgetAttributesReturns data attributes for each BTA widget container.
ParamDescription
onDisplayFires when the BTA Feed block is displayed in the viewport.
onLoadFires when the BTA Feed block is rendered on the page.
onViewedFires when the BTA Feed block is completely viewed.
onElementsReadyFires when ads are loaded and DOM elements inside Shadow DOM are accessible.
onWidgetDisplayFires when a widget enters the viewport.
onBtaFeedDataReceivedFires when BTA Feed data is received.
onLinkClickFires when a link inside the BTA Feed is clicked.
onArticleClickFires when an article is clicked.
onNativeAdClickFires when a native ad is clicked.
onArticleBookmarkFires when an article bookmark action is triggered.
AppStatusDescription
js/apps/bta-feed-prebidCurrentCurrent implementation. Use for all new integrations.
js/apps/bta-feedDeprecatedReplaced by js/apps/bta-feed-prebid. Migration details and websites still using this script are tracked in #18279.