SwAdMrec

Ad Placement Four Essentials

  • Use case: inline rectangle slots such as the article sidebar / right side of the play page (slotKey e.g. home_mrec)
  • Industry form: MREC (IAB Medium Rectangle 300×250; AdSDK format mrec)
  • Visual form: fixed-ratio medium rectangle image, single image direct render / multi-image carousel
  • Tracking events: same as banner — adImpression (once on entering the viewport via IntersectionObserver) / adClick; built-in zero-config, silent no-op when the tracker gate is off

Picking the wrong scenario = wrong ad_type / timing in tracking. See Ad Component Selection.

SwAdMrec is the medium rectangle ad slot (MREC, the industry-standard 300×250) — an "image-type" self-rendering component of the ad foundation. Same lineage as SwAdBanner; the difference is a default ratio of '300/250' (rectangle rather than banner). Impression / click tracking is built in.

MREC rectangle ad

加载中...

Props

NameTypeRequiredDefaultDescription
itemsSwAdItem[]✓—Ad creative array
slotKeystring✓—Ad slot key → ad_slot_key
slotNamestringundefinedAd slot name → ad_slot_name
pageKeystringundefinedPage key → page_key
pageNamestringundefinedPage name → page_name
ratiostring'300/250'Aspect ratio, default standard MREC rectangle
radiusnumber | string0Corner radius (number = px, string passed to SwImage as-is, e.g. '1.125rem')
showAdLabelbooleanundefined"Ad" compliance badge; when not set it follows the global swiftConfig.ad.showLabel (default true), an explicit value always wins
autoplaybooleantrueMulti-image autoplay
autoplayDelaynumber4000Carousel interval (ms)

Events

NamePayloadDescription
load—Creative rendered
empty—items empty
impressionitems: SwAdItem[]Impression (tracking already reported)
clickitem: SwAdItemClick (tracking already reported)
error—Render / load error

Multi-image carousel

加载中...

Sidebar placement (typical IAB MREC)

加载中...

Events

加载中...

Empty @empty

加载中...
<SwAdMrec :items="ads" slot-key="article_mrec" page-key="article" :radius="8" show-ad-label />

Caveats

  • Defaults to a rectangle (300/250); pass ratio to override.
  • Tracking is built in and gated; see Ad & Tracking.