t1k:marketing:monetization:create-ad-unit-from-networks
| Field | Value |
|---|---|
| Module | monetization |
| Version | 1.49.21 |
| Effort | medium |
| Tools | — |
How to invoke
Section titled “How to invoke”/t1k:marketing:monetization:create-ad-unit-from-networksCreate Ad Units From Networks
Section titled “Create Ad Units From Networks”Entry point for creating monetization inventory (app record, placements, ad units) on an ad network, and for handing back the ID map that wires those units into mediation. This skill owns creation and routes each network to the script or reference that does it.
Not this skill: which formats/floors an app should have (→ mediation-strategy), floor tuning on
existing units (→ mintegral playbook 4, max-bid-floor), revenue reporting (→ mintegral-report,
applovin-max), UA campaign/offer creation (advertiser side, different API and keys). Facebook Instant Games placements (App Dashboard, not an API create) → t1k:marketing:monetization:fb-instant-ads.
Executed by
Section titled “Executed by”Creation is a live, permanent write, so every decision (format set, name token, the confirmation)
stays on a reasoning tier (routing SSOT: rules/orchestration-rules.md § “Task-Type → Agent
Routing”). Only the read-only runs are cheap-tier:
| Step | Agent |
|---|---|
Run scripts/mintegral-create-hb-unit.cjs --plan or scripts/dt-create-app-placements.cjs (without --confirm) and report the preview verbatim | t1k-metrics-reporter: read-only, running a script and relaying its output |
Run max-ad-unit.js slots and tabulate the free slots | t1k-metrics-reporter: read-only |
Run bun test scripts/tests/*.test.cjs and report pass/fail | t1k-tester |
Stays reasoning-tier: the AskUserQuestion on the name token, the per-write confirmation, and
every --confirm run. A wrong placement name is permanent.
Network routing
Section titled “Network routing”| Network | Path | Run / read |
|---|---|---|
| Mintegral (in-app bidding for MAX) | API, bundled script | scripts/mintegral-create-hb-unit.cjs (--max-wire attaches MINTEGRAL_BIDDING to the MAX units); procedure references/mintegral-bidding-workflow.md; API SSOT references/mintegral-open-api.md; MAX wiring references/max-bidding-wiring.md |
| DT Exchange (Digital Turbine / Fyber, bidding for MAX) | API, bundled script | scripts/dt-create-app-placements.cjs (app + placements; --max-wire attaches FYBER_BIDDING to the MAX units); API SSOT and MAX wiring references/dt-exchange-management-api.md |
| Liftoff Monetize (Vungle, bidding for MAX) | API, bundled script; app created by the operator | scripts/liftoff-create-placements.cjs --app-id <id> (placements only; --max-package --max-platform attaches VUNGLE_BIDDING to the base MAX unit per format); API SSOT and MAX wiring references/liftoff-monetize-api.md |
| InMobi (audience bidding for MAX) | API, bundled script; app created by the operator | scripts/inmobi-create-placements.cjs --app-id <id> (placements only; --max-package --max-platform attaches INMOBI_BIDDING to the base MAX unit per format; MREC is created as BANNER); API SSOT and MAX wiring references/inmobi-publisher-api.md |
| Moloco (in-app bidding for MAX) | API (undocumented portal endpoints), bundled script; app created by the script when absent | `scripts/moloco-create-ad-units.cjs —package |
| AppLovin MAX (the mediation ad unit itself) | API, sibling skill’s script | t1k-marketing-monetization-applovin-max/scripts/max-ad-unit.js (slots, then create); transcripts t1k-marketing-monetization-applovin-max/references/create-ad-unit.md; naming t1k-marketing-monetization-max-bid-floor/references/ad-unit-conventions.md |
| AdMob | UI only (Partner bidding CHECKED, named (MAX): references/dashboard-and-max-only-partners.md § AdMob) | apps.create / adUnits.create are allowlist-only (403 even with a correct scope). Create in the AdMob UI, read IDs off the confirmation page (Partner-bidding units are not in the adUnits list API): t1k-marketing-monetization-admob § “Creating apps / ad units” |
| BIGO Ads (server bidding for MAX) | API, by hand (no script); app goes through a review gate | references/bigo-inventory-api.md (BIGO_BIDDING; slots only after app status 2) |
| BidMachine | MAX-only, nothing to create | references/dashboard-and-max-only-partners.md (BIDMACHINE_BIDDING, shared source id, unit N/A) |
| Pangle / TikTok | dashboard (browser) | references/dashboard-and-max-only-partners.md (TIKTOK_BIDDING) |
| Meta AN, PubMatic | blocked until the app is live on a store | references/dashboard-and-max-only-partners.md |
| Yandex, Verve | dashboard, the user must sign in; Yandex app can be unpublished (shows “Test mode” below the Active apps, tell the user), MAX wiring is unit id only | references/dashboard-and-max-only-partners.md |
| Unity Ads | dashboard (cloud.unity.com), rename the BP_ default placement names per app; Monetize API is 403 code 53 for every service account | references/dashboard-and-max-only-partners.md § Unity Ads |
MAX _2.._N duplicate units | API refuses; headless UI, then copy networks by API | references/max-duplicate-ad-units.md |
| GAM (shared partner lines) | never created; copy from ZooMaker only with user approval | references/gam-shared-partner-lines.md |
| Chartboost | the studio stopped working with it: SKIP | never create or wire CHARTBOOST_BIDDING |
| ironSource/LevelPlay, others | not automated | See “Adding a network” below. Use each network’s dashboard and the matching network skill. |
The MAX script is reused, never copied: run it from the applovin-max skill directory.
Procedure (every network)
Section titled “Procedure (every network)”- Two operator rules bind before any write — on every network, not just Liftoff:
- The InMobi app is created by the user too (see Gotchas); the same rule as Liftoff.
- The Liftoff app is created by the user, never by a script.
POST /applicationscannot create an app for a game that is not on a store yet (astore.idPlay does not know →400 query <pkg> app store empty; empty →422 minimum string length is 1). Ask for the app id from the dashboard (“Add Application” → “My app is not live yet”); never improvise an app record. - Wire only the base MAX ad unit per format. Units carrying a
_1,_2… rung are left alone — the operator duplicates units later if they want them.--max-unitsnames extras explicitly and is the only override.
- Resolve the app first, read-only. Mintegral:
--plan. DT: run without--confirm(refuses a 2nd app for the same bundle+platform; reuse with--app-id). Liftoff and InMobi: run without--confirm(--app-idis mandatory; the script only reads the app and its placements). Moloco: run without--confirm(looks the app up by--package+--platform;--app-idoptional). MAX:max-ad-unit.js slots --package <pkg> [--platform <p>]. An app may already exist; a second record splits reporting. - Decide formats from surfaces the app really has. Slots are capped and nothing is deletable (Mintegral: no delete endpoint, 10 per format; MAX: disable-only, one unit per package/platform/format via API).
- Confirm the name token with the operator via
AskUserQuestion. Conventions differ per network: Mintegral uses{App}_{Fmt}_AND|ios; DT uses{App}_Banner|Inter|Reward|MREC; Liftoff, InMobi and Moloco use{App}_Banner|Inter|Rewarded|MREC_{AND|ios}(noteRewarded, notReward); MAX uses{App}_{Fmt}_AND|IOSwith_1.._Nrungs (rungs are UI-only). Read existing sibling names; never infer. - Preview. Every script is dry-run without
--confirm. Show the preview. - Explicit confirmation per write, naming the network, account, app, formats and names
(
ad-network-mcp-write-safety). One app per run; no loops over apps without batch approval. - Execute the identical command with
--confirm, then verify on a re-read (every script does). - Wire into mediation. Mintegral →
--max-wire(read-modify-write ofMINTEGRAL_BIDDING, API path inreferences/max-bidding-wiring.md). DT →--max-wire(read-modify-write ofFYBER_BIDDING). Liftoff →--max-package <pkg> --max-platform <p>(read-modify-write ofVUNGLE_BIDDING, keyed on the placementreferenceID). InMobi →--max-package <pkg> --max-platform <p>(read-modify-write ofINMOBI_BIDDING,ad_network_app_id=INMOBI_ACCOUNT_ID, keyed on the numericplacementId). Moloco →--max-wire(read-modify-write ofMOLOCO_BIDDING,ad_network_app_key= the app’ssdk_properties.app_key, noad_network_app_id, line = Moloco ad unit id; MREC skipped unless--max-mrec). All: base unit only unless--max-units. A new MAX unit is live on creation (AppLovin networks enabled); use--disable-afterif it must not serve yet.
Liftoff wiring needs a human eyeball on two names. An app created for an unreleased game has an
empty store.id, so nothing on the Liftoff side names the package. The preview prints the Liftoff app
name next to --max-package; confirm they are the same game before --confirm. The script refuses
when store.id is populated and disagrees — it cannot refuse when it is empty, which is exactly
when the mistake is easy (Mememix placements wired into TheOneFeature’s MAX units).
Credentials
Section titled “Credentials”Env var names only; values live in ~/.config/t1k/ads.env (set -a; . ~/.config/t1k/ads.env; set +a).
Never print, paste or commit a value.
| Network | Env vars |
|---|---|
| Mintegral (developer family) | MINTEGRAL_DEV_SKEY, MINTEGRAL_DEV_SECRET (API Tools → Create APP&Unit API; not the reporting keys) |
| DT Exchange | DT_EXCHANGE_CLIENT_ID, DT_EXCHANGE_CLIENT_SECRET, DT_PUBLISHER_ID (the token’s id claim is not the publisher id: 403) |
| Liftoff Monetize | LIFTOFF_SECRET_TOKEN (dashboard Secret Token). Not LIFTOFF_REPORTING_API_KEY — that key is for report.api.vungle.com and returns 400 {"messages":["Forbidden."],"code":400403} on the publisher API |
| InMobi | INMOBI_USERNAME (account email), INMOBI_ACCOUNT_ID (32-hex; also the MAX ad_network_app_id), INMOBI_API_KEY |
| Moloco | MOLOCO_API_KEY (Publisher Portal -> profile -> API Key, starts pp_; exchanged for a 16 h bearer token, neither is ever printed) |
| AppLovin MAX | APPLOVIN_MANAGEMENT_KEY or MAX_MANAGEMENT_KEY (the Report Key returns 403) |
| Mintegral → MAX wiring (fallback only) | MINTEGRAL_APP_KEY, only for an account with no MINTEGRAL_BIDDING entry in MAX yet |
Missing key → ask the operator to add it to ads.env; do not fall back to another key family.
Adding a network
Section titled “Adding a network”Same shape every time: resolve-or-create app → per-format placements → one unit per placement → emit the mediation wiring table. To add one:
- Confirm the network exposes a documented create API (cite the doc, retrieved date). If it is UI-only or allowlisted, document that in a reference and route to the UI, as AdMob does.
- Add
scripts/<network>-create-*.cjswith the same contract: read-only plan, dry-run default,--confirmto write, explicit name token, re-read after write. One script per network; the auth schemes and format vocabularies share nothing. - Add
scripts/tests/<network>-*.test.cjs(offline fake API; prove preview never writes) and wire it into.github/workflows/floor-skill-ci.yml. - Add
references/<network>-*.mdand a row to the routing table above.
Do not invent endpoints for ironSource: none is verified here yet. Partner facts verified 2026-10-22 are in the two partner references.
Hard rules
Section titled “Hard rules”- Nothing is deletable. Mintegral has no delete endpoint; MAX units are disable-only. Check names before confirming.
- A Liftoff app for an unreleased game cannot be created by API and carries an empty
store.id, so its package is unknowable from the Liftoff side — the operator creates the app and confirms which game it is. See Procedure step 0. - Liftoff MAX wiring keys on
referenceID(MEMEMIX_BANNER_AND-1419211), not the numeric placementid. The app-levelad_network_app_idis the Liftoff app id, not the package. - An InMobi app for an unreleased game cannot be created by API (
POST /v2/appsneedsstoreUrl). The operator makes it in the dashboard (Add Inventory -> Mobile App -> “Click here” -> Manually enter:<Title> (AND), android, Category = Game tag only, rating G) and hands over theappId; the draft app has nostoreUrl, so compare the printed app name with--max-packageby eye. - InMobi has no MREC placement type: MREC is a
BANNERplacement named_MREC_AND. MAX wiring usesINMOBI_BIDDINGwithad_network_app_id=INMOBI_ACCOUNT_ID(not the app id) and the numericplacementId; placements readAPP_INACTIVEuntil the app is live. - Moloco endpoints are the portal’s UNDOCUMENTED ones (Moloco documents only the reporting API); they can change without notice. App create is
POST /v2/publisher-apps(under/publishers/{pub}/it is 501), unit createPOST /v2/ad-units. A not-live game is fine: a future Playstore_urlis accepted. MREC is aBANNERunit; do not wire MREC into MAX unless asked. The script stops at the first non-200: re-read state, never blind-retry. - Removing a network from a MAX unit is a POST with every ad unit
disabled: true(the entry then disappears);ad_network_ad_units: []returns 400. Documented inreferences/liftoff-monetize-api.md§ “Removing Liftoff from a MAX unit”. - MREC and banner share Mintegral
ad_type: banner; only the name tells them apart. - Mintegral App Key is account-wide: not in the Mintegral API, but readable from any existing
MINTEGRAL_BIDDINGentry in MAX (never print it);--max-wirereuses it. - Mintegral
ad_network_ad_unit_idis the UNIT id; the placement id goes inextraParameters.ad_network_optional_placement_id. - Mintegral app create needs
--not-livewhen the package is not on a store yet (verified forcom.theone.feature). - DT
category1takes display names only (Games - Casual); an enum code returns 409. The script checks the android list first. - DT has no app-open format, and a FYBER_BIDDING POST deletes any line it omits: never hand-write one.
- BIGO review gate: a new app is status 1 (auditing);
slot/addfails with code 105 until status 2, andapp/addneedsstoreUrleven for a not-listed app. Seereferences/bigo-inventory-api.md. - Meta AN and PubMatic need a live store app (they read the store listing); do them after release.
- ads.env + Kate stale buffer: if the user has
ads.envopen in Kate while the file is rewritten, a later save restores the stale buffer and reverts fixes. Tell the user to close Kate without saving before editing again; re-check key names after each save. - A bidding unit on a MAX waterfall line never fills; add it as a bidder (
references/max-bidding-wiring.md).
References
Section titled “References”references/mintegral-bidding-workflow.md: Mintegral step-by-step, format table, namingreferences/mintegral-open-api.md: Mintegral endpoint/parameter SSOT, error codes, console equivalentsreferences/max-bidding-wiring.md: Mintegral → MAX bidder setup and verificationreferences/dt-exchange-management-api.md: DT Exchange endpoints, gotchas, naming, FYBER_BIDDING wiringreferences/inmobi-publisher-api.md: InMobi publisher endpoints, headers, the app-creation constraint, placement enum, INMOBI_BIDDING wiringreferences/moloco-publisher-api.md: Moloco portal endpoints (undocumented), token exchange, app/unit create bodies, MOLOCO_BIDDING wiringreferences/liftoff-monetize-api.md: Liftoff Monetize endpoints, the app-creation constraint, house settings, VUNGLE_BIDDING wiring + removalreferences/bigo-inventory-api.md: BIGO auth/sign, storeUrl gotcha, review gate, slot bodies, BIGO_BIDDING wiringreferences/dashboard-and-max-only-partners.md: BidMachine, Pangle, Meta, PubMatic, Yandex, Verve, AdMob UI, Unity Ads dashboard, Chartboostreferences/max-duplicate-ad-units.md: MAX_2.._N units via headless UI + network copyreferences/gam-shared-partner-lines.md: GAM shared partner lines, ZooMaker template- Mintegral Developer Interface Documentation: https://cdn-adn-https.rayjump.com/cdn-adn/open_api/MintegralAPI.html [retrieved 2026-08-27]