Skip to content

NativeAdSlot

Displays a contextually targeted native ad inline within your app's feed or UI.

Native ad slot displayed inline within a mobile app feed

Basic Usage

jsx
function CharacterFeed({ character }) {
  return character.map((character, index) => (
    <>
      <Character key={index} name={name} img={img} />
      {index % 10 === 9 && (
        <NativeAdSlot adUnitId="character-feed" position={Math.floor(index / 10)} />
      )}
    </>
  ));
}

Props

PropTypeRequiredDefaultDescription
adUnitIdstringNoAd unit ID provided by Simula. Used for measurement and improved targeting.
positionnumberYesIndex position in feed
contextNativeContextNoContextual signals for ad relevance
widthnumber | stringNoFills parent< 1 = percentage, >= 1 = pixels, "80%" = percentage string. Min 320px.
onImpression(ad: AdData) => voidNoFires when ad enters viewport
onError(error: Error) => voidNoFires on load failure

The more context you provide, the better the ad relevance.

typescript
interface NativeContext {
  searchTerm?: string;
  tags?: string[];
  category?: string;
  title?: string;
  description?: string;
  userProfile?: string;
  userEmail?: string;
  nsfw?: boolean;
  customContext?: Record<string, string | string[]>;
}

Use customContext for any additional signals that help Simula understand user intent — top character interactions, user profile, etc:

jsx
customContext: {
  recentCharactersViewed: [
    "Frieren - An immortal elf mage who reflects on centuries of adventure after the hero's journey ends",
    "Rudeus Greyrat - A reincarnated shut-in seeking redemption in a fantasy world",
  ],
}