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.
AdConsole Configuration
Section titled “AdConsole Configuration”Located under Yaleo / BTA Feed: https://app.adconsole.com/yaleo/bta-feed/v2
Integration
Section titled “Integration”Direct
Section titled “Direct”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'), });});Headertag Raw JS
Section titled “Headertag Raw JS”The integration script is deployed as a Raw JS entry in Headertag.
- Assign the BTA Integration Script (Prebid) script from AdConsole / Raw Scripts to the tag. The script defines the
setupBtaFeedfunction:
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(); }};- Add a new Raw JS script that calls
setupBtaFeedwith the target element ID and BTA Feed ID:
setupBtaFeed('target-element-id', '00000000-0000-0000-0000-000000000000');Helper Scripts
Section titled “Helper Scripts”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.
Parameters
Section titled “Parameters”window.adnzBtaFeed.start() accepts the following options:
Options
Section titled “Options”| Param | Type | Default | Description |
|---|---|---|---|
btaFeedId | string | — | Required. The BTA Feed ID. |
element | HTMLElement | — | Target element. If not provided, created next to the script tag. |
debug | boolean | — | Enables app-specific debug logging and test mode for ads, and changes Shadow DOM mode to open. |
forceMobile | boolean | — | Forces mobile configuration. |
forceEnabled | boolean | — | Forces the feed to be enabled regardless of backend configuration. |
forceDarkTheme | boolean | — | Forces 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. |
isDarkThemeSupported | boolean | — | Enables 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. |
iframeMode | boolean | — | Indicates 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. |
mockRecommendations | boolean | — | Uses mock data instead of real recommendations. |
newItemMarkup | boolean | false | Uses updated HTML markup for articles and ads. |
endlessScrollEnabled | boolean | false | Enables infinite scroll on the last Yaleo placement widget. |
lazyLoading | boolean | false | Loads ads only when the BTA Feed is visible in the viewport. |
headerTagUndoEffectEnabled | boolean | false | Saves the cleanup effect to the Header Tag’s undo effect stack. |
isDisabled | () => boolean | () => false | Returns true to disable the feed, e.g. based on user language. |
brandingTagLocation | BrandingTagLocation | PLACEMENT_CONTAINER | Where to display the branding tag. |
url | string | null | — | Overrides the page URL used for targeting and analytics. |
forceXandrCreativeId | number | — | Forces all native ads to use a specific Xandr creative ID. Disables non-Xandr bidders when set. |
containerAttributes | DataAttributes | — | Data attributes for the BTA section container element. |
containerClassName | ClassnamesArgument | — | CSS class name(s) for the container element. |
widgetListClassName | ClassnamesArgument | — | CSS class name(s) for the widget list container. |
yaleoPlacementContentClassName | ClassnamesArgument | — | CSS class name(s) for Yaleo placement widget content containers. |
Formatters
Section titled “Formatters”| Param | Description |
|---|---|
formatArticleDate | Formats article dates. |
formatReadingTime | Formats article reading time. |
formatRequestParams | Modifies request parameters before sending to the server. |
formatYaleoPlacementItems | Formats, filters, or sorts Yaleo placement items. |
getAdUrl | Overrides ad URLs. Useful for mobile app deep links. |
getAdAttributes | Returns data attributes for ad elements. |
getArticleClassNames | Returns custom class names for article elements. |
getArticleMeta | Returns initial article meta data. |
getArticleAttributes | Returns data attributes for article elements. |
getArticleUrl | Overrides article URLs. Useful for mobile app deep links. |
getWidgetAttributes | Returns data attributes for each BTA widget container. |
Events
Section titled “Events”| Param | Description |
|---|---|
onDisplay | Fires when the BTA Feed block is displayed in the viewport. |
onLoad | Fires when the BTA Feed block is rendered on the page. |
onViewed | Fires when the BTA Feed block is completely viewed. |
onElementsReady | Fires when ads are loaded and DOM elements inside Shadow DOM are accessible. |
onWidgetDisplay | Fires when a widget enters the viewport. |
onBtaFeedDataReceived | Fires when BTA Feed data is received. |
onLinkClick | Fires when a link inside the BTA Feed is clicked. |
onArticleClick | Fires when an article is clicked. |
onNativeAdClick | Fires when a native ad is clicked. |
onArticleBookmark | Fires when an article bookmark action is triggered. |
Applications
Section titled “Applications”| App | Status | Description |
|---|---|---|
js/apps/bta-feed-prebid | Current | Current implementation. Use for all new integrations. |
js/apps/bta-feed | Deprecated | Replaced by js/apps/bta-feed-prebid. Migration details and websites still using this script are tracked in #18279. |