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 offPicking 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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
items | SwAdItem[] | ✓ | — | Ad creative array |
slotKey | string | ✓ | — | Ad slot key → ad_slot_key |
slotName | string | undefined | Ad slot name → ad_slot_name | |
pageKey | string | undefined | Page key → page_key | |
pageName | string | undefined | Page name → page_name | |
ratio | string | '300/250' | Aspect ratio, default standard MREC rectangle | |
radius | number | string | 0 | Corner radius (number = px, string passed to SwImage as-is, e.g. '1.125rem') | |
showAdLabel | boolean | undefined | "Ad" compliance badge; when not set it follows the global swiftConfig.ad.showLabel (default true), an explicit value always wins | |
autoplay | boolean | true | Multi-image autoplay | |
autoplayDelay | number | 4000 | Carousel interval (ms) |
Events
| Name | Payload | Description |
|---|---|---|
load | — | Creative rendered |
empty | — | items empty |
impression | items: SwAdItem[] | Impression (tracking already reported) |
click | item: SwAdItem | Click (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); passratioto override. - Tracking is built in and gated; see Ad & Tracking.