Serve your first ad

Let Genuin place ads inside your feeds, render an IAB unit from a tag in your app, or run your posts as an ad creative on a partner page.

Monetization is configured in Brand Control Center: the ad server, floors, authorized sellers, sponsorships, and creatives. The developer's part is to give ads a place to render, and there are three places. Pick the one that matches where your audience is, and the first ad is one step away.

SurfaceWhere it runsWhat you doWhat Genuin does
In-feed adsInside embeds and placements, on the web and in iOS and Android appsAdd the embed. Optionally pass targeting.Inserts ad items into the feed and plays them in the player
IAB ad unitA fixed-size slot in your Android, iOS, or React Native appPlace an ad view with a tag IDFetches the tag's creatives, renders, tracks the impression
Ad creativeA partner's web page or ad serverPaste the generated codeRenders up to ten of your posts as a video ad unit

Before you begin

You needForWhere to get it
Brand API keyEvery SDKBrand Control Center: Build > Publish Brand Community > SDK Integration, with a key per environment (Live, QA). Keep it out of source control.
Ad configurationIn-feed adsYour team sets up the ad server and sponsorships in Brand Control Center under Monetize. Nothing in your code turns ads on or off.
Tag IDIAB ad unitsThe id of an iAB Standard Tag, created under Grow > Off Site > Extended > iAB Standard Tag and accepted for your brand. Your Genuin team passes it to you.
Ad creative codeAd creativesGrow > Off Site > Ad Creatives > View Code in Brand Control Center

Path A: Let ads run inside your embeds

On every surface the same thing happens: the feed Genuin returns for an embed or a placement carries ad items next to the videos, and the player renders them. There's no ad-specific setup in your code.

Web

Add the embed as in Embed the Genuin Web SDK on your website. The SDK reads the page's <meta name="keywords">, the page URL, and a geo-IP location on its own and sends them with every feed and ad request. Pass targeting to override them or to add the key-values your sponsorships target on:

index.html
html
<div id="gen-sdk" class="gen-sdk-class" style="width: 100%; height: 600px;"></div>
<script src="https://media.begenuin.com/sdk/2.0.6/gen_sdk.min.js"></script>
<script>
  window.genuin.init({
    container_id: "gen-sdk",
    embed_id: "{{EMBED_ID}}",
    api_key: "<<YOUR_API_KEY>>",
    targeting: {
      keywords: ["trail running", "race recaps"],
      page_url: "https://www.example.com/articles/ridge-50k",
      key_value: { genre: "sports", section: "running" }
    }
  });
</script>
FieldTypeDefaultNotes
keywordsstring or string[]The page's <meta name="keywords">Up to 100 keywords of 256 characters each. A comma-separated string is split and de-duplicated.
locationobjectGeo-IPAny subset of the location fields overrides the lookup.
page_urlstringwindow.locationUp to 2,048 characters.
key_valueobjectnoneUp to 50 entries, keys up to 128 characters, values up to 1,024. Use the keys your sponsorship targeting is configured with.
sponsorship_idstring[]The embed's own sponsorshipA separate init option that overrides the sponsorship attached to the embed or placement.

update({ container_id, targeting }) replaces the whole targeting object, so a field you leave out is cleared.

iOS and Android apps

Embeds in the community SDKs carry the same ad items. Two platform declarations are needed before personalized ads serve:

  • Android: declare the advertising ID permission, com.google.android.gms.permission.AD_ID, and answer the Advertising ID questionnaire in Google Play Console. See Integrate the Genuin Android SDK.
  • iOS: request tracking authorization with ATTrackingManager.requestTrackingAuthorization and declare Advertising Data in App Store Connect. Without authorization the advertising identifier is zeroed and personalized ads don't serve. See Integrate the Genuin iOS SDK.

Path B: Render an IAB unit in your app

The iAB Standard Size Experience SDK renders tag-driven IAB units (Interactive Advertising Bureau standard sizes such as 300×250 and 320×50). It's a separate family from the community SDKs. On Android it's com.begenuin:genuin-sdk, feed, instream-ads, and core-v3 (0.v3.11). On iOS it's the GenuinSDK and GenuinInStreamAds products of the genuininc/ios_sdk package (0.0.5). In React Native it's genuin-react-native-ads-v3 (1.4.0, Android only). The two families can live in one app.

Step 1: Add the SDK

Step 2: Initialize once at launch

Initialize before any ad view is created. On Android a slot that composes first throws IllegalStateException: SDK not initialized; on iOS a view without the ads module fails with BGTagError.adsManagerUnavailable.

MyApp.kt
kotlin
import android.app.Application
import com.begenuin.core.enums.GenuinEnv
import com.begenuin.sdk.GenuinSDK

class MyApp : Application() {
  override fun onCreate() {
    super.onCreate()
    GenuinSDK.initialize(
      context = this,
      apiKey = BuildConfig.GENUIN_API_KEY,   // injected at build time, never a literal
      env = GenuinEnv.PROD                   // GenuinEnv.QA only with a QA key
    )
  }
}
MyApp.swift
swift
import SwiftUI
import GenuinSDK
import GenuinInStreamAds

@main
struct MyApp: App {
    init() {
        Genuin.shared.initialize(
            modules: [BGInStreamAds.module],
            apiKey: "<<YOUR_API_KEY>>",
            config: BGSDKConfig(navigationStyle: .system, environment: .prod)
        ) { result in
            if case .failure(let error) = result { print("Genuin init failed: \(error)") }
        }
    }
    var body: some Scene { WindowGroup { ContentView() } }
}
App.tsx
tsx
import { useEffect, useState } from 'react';
import { Platform } from 'react-native';
import { initialize } from 'genuin-react-native-ads-v3';

export function useGenuinAds(): boolean {
  const [ready, setReady] = useState(false);
  useEffect(() => {
    if (Platform.OS !== 'android') return;
    initialize({ apiKey: '<<YOUR_API_KEY>>', env: 'PROD' })
      .then(() => setReady(true))
      .catch(console.error);
  }, []);
  return ready;
}

Step 3: Place the ad view

Pick the view that matches the slot size and pass the tag ID. The view fetches the tag's creatives, renders, and tracks the impression. Each view fixes its own height and takes the width of its container.

ArticleScreen.kt
kotlin
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.begenuin.feed.views.BG300x250AdView

@Composable
fun ArticleScreen() {
  Column {
    ArticleBody()
    BG300x250AdView(tagId = "{{TAG_ID}}", modifier = Modifier.fillMaxWidth())
  }
}
AdView.swift
swift
import SwiftUI
import GenuinInStreamAds
import Core

struct ContentView: View {
    var body: some View {
        VStack {
            BGNavigationRoot {
                BG300x250AdView(tagID: "{{TAG_ID}}")
            }
        }
        .padding()
    }
}
ArticleScreen.tsx
tsx
import { GenuinAd, GenuinAdFormat } from 'genuin-react-native-ads-v3';

export default function ArticleScreen() {
  const ready = useGenuinAds();
  return (
    <>
      <ArticleBody />
      {ready && <GenuinAd tagId="{{TAG_ID}}" format={GenuinAdFormat.SIZE_300X250} />}
    </>
  );
}
SizeAndroid composableiOS viewTypical use
320 × 50BG320x50AdViewBG320x50AdViewStandard banner
320 × 100BG320x100AdViewBG320x100AdViewLarge banner
300 × 250BG300x250AdViewBG300x250AdViewMedium rectangle, the default
300 × 250 collapsing to 300 × 50BGCollapsibleAdViewBGCollapsibleAdViewCollapsible unit
320 × 480BG320x480AdViewBG320x480AdViewHalf-page portrait
300 × 600BG300x600AdViewBG300x600AdViewHalf-page filmstrip
1280 × 720BG1280x720AdView—Fixed 16:9 landscape
Fills its boxBGFSLandscapeAdView—Flexible landscape

In React Native the format prop takes a GenuinAdFormat constant named after the size and defaults to SIZE_300X250. Each view reports lifecycle events you can observe (onEvent on Android, a BGAdDelegate on iOS, onAdEvent in React Native); the SDK tracks impressions on its own.

Path C: Run your posts as an ad creative on a partner page

An ad creative packages up to ten approved posts as a 300×600 or 300×250 video ad unit that any web page or ad server can run. Create it in Brand Control Center under Grow > Off Site > Ad Creatives, then copy the code from View Code. Don't retype it: it carries the creative's id and the current script URL.

creative.html
html
<script src="https://tpc.googlesyndication.com/pagead/gadgets/html5/api/exitapi.js"></script>
<div class="gen-ext" data-tag-id="{{AD_CREATIVE_ID}}" style="width: 300px; height: 600px;"></div>
<script src="<<GENUIN_OFFSITE_SCRIPT_URL>>" defer></script>
<script>
  document.addEventListener('click', function (e) {
    if (e.target.closest('[data-cta="true"]') && typeof ExitApi !== 'undefined') ExitApi.exit();
  });
</script>

The script finds every gen-ext container on the page and loads each creative by its data-tag-id. It picks the layout from the container size, plays the posts muted, and shows the call to action after the delay you set. Uploaded as an HTML5 creative in Google Ad Manager, the call-to-action click reaches Google's Exit API and counts as the click-through. Each post's pixel URL fires when that post plays, and every player event reaches Genuin's analytics.

Limitations

  • Ads are configured in Brand Control Center, not in code. No SDK call turns in-feed ads on, sets floors, or picks a demand source.
  • Tag IDs aren't self-serve. Brand Control Center creates iAB Standard Tags as proposals between brands; the id reaches your app through your Genuin team.
  • React Native renders ad units on Android only in 1.4.0.
  • Ad creatives come in two sizes. The 320-wide banner sizes exist only as iAB Standard Tags.

See also

TRUST AND COMPLIANCE

© 2026 Genuin Inc.

Genuin Footer