Back to blog
Tech

Where is the ad decided? CSAI, SSAI and SGAI explained

|
Published Nov 25, 2026
|
Read Time 11 min
|
Share
Qualabs blog cover: Where is the ad decided? CSAI, SSAI and SGAI explained
Summary

Every streaming ad break answers one question: where is the ad each viewer sees decided? Client-side insertion decides in the player, server-side insertion decides on the server, and server-guided insertion splits the work between them. This guide explains what each answer changes for devices, CDN caching, ad blockers, measurement and ad formats, and how to choose.

Ever wondered how the ad you see mid-game gets there?
Where the ad is decided
CSAI · Client-Side Ad Insertion CSAI: the ad is decided in the player app, through an ads SDKSCTE-35 · AD BREAKad markerLive streamPackagerPlayer app + ads SDKAdserver

In the player app. An ads SDK pauses the content and requests the ad.

SSAI · Server-Side Ad Insertion SSAI: the ad is decided in the packager, for each viewerSCTE-35 · AD BREAK1 stream per viewerLive streamPackagerPlayer / TVAdserver

In the packager. It asks the ad server for each viewer's ad and stitches it in.

SGAI · Server-Guided Ad Insertion SGAI: the packager marks the break once and each player asks the ad server for its adSCTE-35 · AD BREAKAD HERE · onceLive streamPackagerPlayer / TVAdserver

In each player, with the ad server. The packager only marks the spot, once, for everyone.

Every ad break answers one question: where is the ad decided?

Comparing ad insertion techniques feature by feature hides what matters. A more useful starting point is one question: at what point in the delivery chain is each viewer's ad chosen? The answer determines which devices you reach, what your CDN can cache, how exposed your breaks are to ad blockers, what you can measure and which ad formats you can sell. Client-side ad insertion (CSAI), server-side ad insertion (SSAI) and server-guided ad insertion (SGAI) each give a different answer.

CSAI: the player decides, with an ads SDK in the app

In CSAI, the decision lives on the device. An ads SDK inside the app watches for ad markers; at each one, the player pauses the content, requests an ad and resumes when it ends. The request can use data from the viewing session, the player can handle different media types, and interaction metrics are typically more accurate because delivery happens on the client.

The trade-offs come from the same place. Results depend on each client's capabilities, pausing to load an ad can cause buffering or latency, and the pause, request and resume cycle makes ads easier for ad blockers to detect.

CSAI: the player app asks for the ad
Live stream
Packager
Player appwith an ads SDK
Ad server
requestad
  1. Signal. An ad marker travels with the content to the player.
  2. Request. The ads SDK pauses the content and requests an ad, with data from the viewing session.
  3. Ad returned. The player loads the ad it received.
  4. What the viewer sees. The ad, then the content resumes. Loading the ad can cause buffering.
Ad SDK in the appSession data in the requestEasier for ad blockers to spot

SSAI: the server decides and builds a manifest for each viewer

In SSAI, the decision moves to the server. Ads are fetched ahead of the break and stitched into the stream, matched to its bitrate, frame rate and audio level. With no ad logic in the client, the experience is more consistent across platforms and devices, and ad blockers are less effective at identifying stitched ads.

The cost is that the server has to generate and serve a personalized manifest for each session. That is the only per-viewer piece: the video segments of the content and of the ads remain cacheable, so SSAI does not duplicate the video for every viewer. For ad ops, two more limits apply: fetched ads cannot be adjusted in the moment, and viewability and interaction metrics need additional mechanisms. Adding client-side tracking makes those ads susceptible to ad blockers again.

SSAI: the packager asks for each viewer's ad
Live stream
Packagerstitches the ad in
Player / TV
Ad server
requestad
  1. Signal. A SCTE-35 cue marks the ad break in the live stream.
  2. Request. The packager asks the ad server for each viewer's ad, ahead of the break.
  3. Ad returned. The ad is stitched into a manifest built for that viewer's session.
  4. What the viewer sees. One continuous stream, with the ad already inside it.
1 stream per viewerAny deviceHeavy at scale
Example · one manifest per viewer (HLS, simplified)Segments stay cacheable
Viewer 1
#EXTM3U
#EXT-X-TARGETDURATION:6
#EXTINF:6.0,
https://cdn.example.com/game/seg-101.ts
#EXT-X-DISCONTINUITY
#EXTINF:6.0,
https://ads.example.com/creative-a/seg-1.ts
#EXTINF:6.0,
https://ads.example.com/creative-a/seg-2.ts
#EXT-X-DISCONTINUITY
#EXTINF:6.0,
https://cdn.example.com/game/seg-102.ts
Viewer 2
#EXTM3U
#EXT-X-TARGETDURATION:6
#EXTINF:6.0,
https://cdn.example.com/game/seg-101.ts
#EXT-X-DISCONTINUITY
#EXTINF:6.0,
https://ads.example.com/creative-b/seg-1.ts
#EXTINF:6.0,
https://ads.example.com/creative-b/seg-2.ts
#EXT-X-DISCONTINUITY
#EXTINF:6.0,
https://cdn.example.com/game/seg-102.ts
Two sessions of the same game. Only the manifest differs: the ad lines (highlighted) point to the ad chosen for each viewer, and EXT-X-DISCONTINUITY marks the switch between content and ad. The segment files themselves are shared, so the CDN can cache them.

SGAI: the server marks the break once and each player requests its ad

In SGAI, the server signals the break once, in a manifest that is the same for every viewer, and each player requests its own ad when it reaches the break. Because ads are referenced as separate assets instead of being stitched into the media playlists, the manifest can be cached. The ad decision leaves the video pipeline: ads are scheduled on the content timeline as separate assets, which allows late-binding ad decisioning without conditioning ads with the primary content. SGAI also enables formats that are hard to stitch, such as overlays, L-shape and squeezeback.

SGAI has limits. It needs player support: a player that does not implement it ignores the break and keeps playing the content, and support varies between players today. Against ad blockers, SGAI sits between the other two: the break is signaled by the server in the standard manifest, without an ads SDK, but the ad is still a separate request made by the player.

SGAI: the packager marks the spot and each player asks
Live stream
Packagermarks the break
Player / TVasks for its own ad
Ad server
requestad
  1. Signal. The packager marks the break once, in the manifest that every viewer shares.
  2. Request. When it reaches the break, each player asks the ad server for its own ad.
  3. Ad returned. One ad or a list of ads, referenced as separate assets.
  4. What the viewer sees. Its own ad, then the content. A player without SGAI support keeps playing the content.
One streamYour adNeeds player support
What the viewer sees during one ad break
CSAIplayer app
Content
Pauseload ad
Ad
Contentresumes
SSAIstitched
Content
Adinside the stream
Content
SGAIguided
Content
Your adseparate asset
Contentlive edge
SGAIno support
Content
Contentbreak ignored
Content
ContentAdPause while the ad loads
Illustrative, not to scale. In CSAI the player stops to fetch the ad; in SSAI the ad arrives already inside the stream; in SGAI the player switches to a separate ad asset and, in a live stream, comes back at the live edge.

CSAI, SSAI and SGAI side by side

Comparison of CSAI, SSAI and SGAI
AspectCSAISSAISGAI
Where the ad is decidedPlayerIn the player, through an ads SDK in the app, using data from the viewing session.ServerOn the server, which fetches the ads and stitches them into the stream.Server + playerThe server places the break once for everyone. Each player requests its ad at break time.
Manifest and CDN cacheUnchangedThe content manifest does not change. The player requests the ad separately.Per sessionOne personalized manifest per session. Content and ad segments remain cacheable.One for allOne manifest for all viewers, which can be cached. Ads are referenced as separate assets.
DevicesClient-dependentDepends on the capabilities of each client.ConsistentMore consistent across a wide range of platforms and devices.Player supportNeeds player support. Players without it ignore the break and keep playing the content.
Ad blockersMore exposedMore exposed, because of the pause, request and resume cycle on the client.Less exposedLess exposed: stitched ads are harder to identify.In betweenIn between: no ads SDK, but the player makes a separate ad request.
MeasurementClient-sideInteraction metrics are typically more accurate, because delivery happens on the client.Extra mechanismsViewability and interactions need additional mechanisms.Player beaconsThe player sends impression and quartile beacons. In MPEG-DASH, tracking information from a VAST response can travel with the break.
Possible formatsVaried mediaDifferent media types, adjusted to the viewing session.LinearLinear ads stitched into the stream. Some interactive or dynamic creatives may not be fully supported.Linear + non-linearLinear breaks plus non-linear formats such as overlays, L-shape and squeezeback.
Startup and syncCan bufferPausing to load an ad can cause buffering or latency.SmoothSmoother transitions, but ads cannot be adjusted once fetched.Late bindingThe player loads the ad after buffering the content. The break can snap to segment boundaries, and a live stream resumes at the live edge.

Teal marks a strength, orange a cost to plan for and gray a neutral trait.

How HLS and MPEG-DASH signal a server-guided break

In HLS, the server schedules an interstitial by placing an EXT-X-DATERANGE tag in the media playlists of the primary content. The tag points to the ad in one of two ways. X-ASSET-URI points directly to a single interstitial asset, which works when the ad is known when the playlist is written. X-ASSET-LIST points to a JSON object that the player resolves at playback time. It lists each ad with its URI and duration, and an empty list tells the player to skip the break and continue with the content. Other attributes set where the content resumes (X-RESUME-OFFSET), cap playout time (X-PLAYOUT-LIMIT) and snap the break to segment boundaries (X-SNAP). Interstitials must be VOD assets, scheduled against VOD or live content. All of this is defined in the current IETF draft of the HLS specification.

Example · HLS interstitial with X-ASSET-URIOne playlist for everyone
#EXTM3U
#EXT-X-TARGETDURATION:6
#EXT-X-PROGRAM-DATE-TIME:2026-11-25T20:00:00.000Z
#EXTINF:6.0,
game-001.mp4
#EXTINF:6.0,
game-002.mp4
#EXT-X-DATERANGE:ID="break-1",CLASS="com.apple.hls.interstitial",
  START-DATE="2026-11-25T20:00:12.000Z",DURATION=30.0,
  X-ASSET-URI="https://ads.example.com/ad-1/main.m3u8",
  X-SNAP="OUT,IN"
A media playlist of the game. The highlighted tag schedules a break and points straight to one ad. X-SNAP="OUT,IN" asks the player to leave and rejoin the content at segment boundaries. Line breaks inside the tag are added for readability.
Example · the same break with X-ASSET-LISTResolved at playback
#EXT-X-DATERANGE:ID="break-1",CLASS="com.apple.hls.interstitial",
  START-DATE="2026-11-25T20:00:12.000Z",DURATION=30.0,
  X-ASSET-LIST="https://ads.example.com/breaks/break-1.json"
JSON returned to one player
{
  "ASSETS": [
    {
      "URI": "https://ads.example.com/ad-1/main.m3u8",
      "DURATION": 15.0
    },
    {
      "URI": "https://ads.example.com/ad-2/main.m3u8",
      "DURATION": 15.0
    }
  ]
}
No ad for this viewer
{ "ASSETS": [] }
The playlist stays the same for every viewer; the JSON behind X-ASSET-LIST can differ per request. The player plays the listed ads back to back, and an empty list makes it skip the break.

MPEG-DASH 6th edition does the same with Alternative MPD events. An InsertPresentation event inserts an alternative presentation at a point in playback, and the original content resumes afterward, which fits VOD. A ReplacePresentation event replaces the current presentation for a period, which fits live ad breaks and regional blackouts, and it can set a maximum duration and a resumption point. ListMPD lets the player assemble a break from a list of ad MPDs instead of the server merging them, and it can be built from a VAST response with its tracking information. The DASH-IF reference implementation uses a ReplacePresentation event per break whose URI returns a personalized List MPD.

Example · MPEG-DASH Alternative MPD eventOne MPD for everyone
<!-- Live MPD: the same for every viewer (simplified) -->
<MPD type="dynamic" ...>
  <Period id="1" start="PT0S">
    <EventStream schemeIdUri="urn:mpeg:dash:event:alternativeMPD:replace:2025"
                 timescale="90000">
      <Event id="1" presentationTime="2700000" duration="1800000">
        <ReplacePresentation
            uri="https://ads.example.com/sgai/ads?break=1"
            maxDuration="1800000" clip="true"/>
      </Event>
    </EventStream>
    <AdaptationSet ...> ... </AdaptationSet>
  </Period>
</MPD>
<!-- List MPD returned to one viewer (simplified) -->
<MPD type="list" profiles="urn:mpeg:dash:profile:list:2024">
  <Period id="1">
    <ImportedMPD>https://ads.example.com/ad-1/manifest.mpd</ImportedMPD>
  </Period>
  <Period id="2">
    <ImportedMPD>https://ads.example.com/ad-2/manifest.mpd</ImportedMPD>
  </Period>
</MPD>
Simplified: namespaces, the media of the main MPD and the tracking events of the List MPD are left out. The live MPD carries one ReplacePresentation event per break; its URI returns a List MPD with one Period per ad, each importing that ad's MPD. For VOD, an InsertPresentation event plays the alternative content and then resumes where it left off.

Non-linear formats and our work on SGAI

When the player composes content and ad, the ad does not have to replace the content. Overlays, L-shape and squeezeback show both on screen at once, and they cannot really be stitched into the stream. They depend on the same condition as any SGAI break: player support.

Non-linear formats: the game stays on screen
AdL-shapeThe game shrinks to one corner and the ad wraps it on two sides.
AdSqueezebackThe game is squeezed into a smaller window and the ad fills the frame around it.
AdSide-by-sideThe game and the ad share the screen in two panels.
AdOverlayThe game keeps the full screen and the ad sits on top of part of it.
Illustrative layouts. The player composes the game and the ad on screen, which is why these formats depend on player support.

At Qualabs, our team worked on the SGAI specification for MPEG-DASH, for both linear and non-linear ads. We also built the demo of non-linear ads in HLS that was shown at HLS Interest Day.

How to choose an ad insertion approach

  1. List the devices and players you must reach, and check which of them support HLS interstitials or MPEG-DASH Alternative MPD events.
  2. Estimate your peak concurrent sessions, because SSAI generates and serves one manifest for each of them.
  3. Decide how much ad-blocker exposure you can accept on each platform.
  4. Agree with your buyers on the metrics they require and on where each beacon will fire.
  5. Decide whether you plan to sell non-linear formats, which need SGAI and player support.
  6. Plan a fallback for players without SGAI support, such as serving them stitched sessions from the same setup.
Four questions that point to a technique
Step 1

Do the players you must reach support HLS interstitials or DASH Alternative MPD events?

Yes: SGAI is an optionNo: SSAI or CSAI for those players
Step 2

Do you expect large peaks of concurrent sessions?

SSAI: one manifest per sessionSGAI: one manifest for everyone
Step 3

How much ad-blocker exposure can you accept?

Least: SSAIIn between: SGAIMost exposed: CSAI
Step 5

Will you sell overlays, L-shape or squeezeback?

Yes: SGAI, with player support
Step 6

A mixed fleet does not force one answer: the same setup can serve stitched sessions to players without SGAI support.

SSAI + SGAI

FAQ about ad insertion

What is the difference between CSAI, SSAI and SGAI?

Where each viewer's ad is decided: in the player for CSAI, on the server for SSAI, and split for SGAI, where the server marks the break once and each player requests its ad.

Does SSAI duplicate the video for every viewer?

No. The video segments of the content and of the ads remain cacheable, and what is generated per viewer is the manifest.

What happens if a player does not support SGAI?

It ignores the break signaling and keeps playing the content, so the viewer sees the content instead of an ad.

Is SGAI immune to ad blockers?

No. It does not need an ads SDK in the app, but the player still requests the ad separately, which leaves it between CSAI and SSAI.

Can SSAI and SGAI run together?

Yes. One setup can let each session choose stitched or guided insertion, so players without SGAI support still receive ads.

Every ad break is an engineering decision

Which one scales better?

Talk to our team →

Video engineering for streaming and broadcast

Stay Updated

Get the latest on media tech trends, events, and insights delivered to your inbox.