Skip to content

Latest commit

 

History

History
2071 lines (1249 loc) · 39.9 KB

MonetizeAPI.md

File metadata and controls

2071 lines (1249 loc) · 39.9 KB

Monetization API

Methods

Enums

addApp

addApp(storeUrl, taxonomy, coppa, options?): Promise<string>

Parameters

Name Type Description
storeUrl string URL to the store of the live app
taxonomy string | Taxonomy -
coppa boolean Is app COPPA.
options? Object -
options.adUnitStatus? Map<AdUnits, AdUnitStatus> Optional: Map of AdUnits MonetizeEnums.AdUnits and their status MonetizeEnums.AdUnitStatus
options.ccpa? boolean Optional: Is app CCPA.

Returns

Promise<string>

addApp(appName, platform, coppa, options?): Promise<string>

Parameters

Name Type Description
appName string Temporary app's name
platform PLATFORM Temporary app's platform
coppa boolean Is app COPPA.
options? Object -
options.adUnitStatus? Map<AdUnits, AdUnitStatus> -
options.ccpa? boolean Optional: Is app CCPA.

Returns

Promise<string>


addInstances

addInstances(applicationKey, instances): Promise<string>

Parameters

Name Type Description
applicationKey string Application Key to add instance to.
instances InstanceConfig[] List of InstanceConfigs to be add.

Note: To add instances to a network that already exists, pass instance objects with empty app config ('')

Returns

Promise<string>


addPlacements

addPlacements(applicationKey, placements): Promise<string>

Parameters

Name Type
applicationKey string
placements Placement[]

Returns

Promise<string>


createMediationGroup

createMediationGroup(applicationKey, adUnit, groupName, groupCountries, groupOptions): Promise<string>

Parameters

Name Type Description
applicationKey string The application key to create the group for.
adUnit AdUnits The Ad Unit to create the application for see AdUnits
groupName string Group name
groupCountries string[] List of group countries in ISO 3166-1 Alpha-2
groupOptions Object Optional group parameters
groupOptions.adSourcePriority? MediationGroupPriority AdSource and their priority
groupOptions.groupPosition? number Position of the group in the group list
groupOptions.groupSegments? number Segment ID attached to the group

Returns

Promise<string>


deleteInstance

deleteInstance(applicationKey, instanceId): Promise<string>

Parameters

Name Type Description
applicationKey string Application key to delete instance for.
instanceId number Instance ID to delete.

Returns

Promise<string>


deleteMediationGroup

deleteMediationGroup(applicationKey, groupId): Promise<string>

Parameters

Name Type Description
applicationKey string Application Key to delete the group for.
groupId number Group ID to delete.

Returns

Promise<string>


deletePlacement

deletePlacement(applicationKey, adUnit, placementId): Promise<string>

Parameters

Name Type
applicationKey string
adUnit AdUnits
placementId number

Returns

Promise<string>


getARMReport

getARMReport(date, appKey): Promise<string>

Parameters

Name Type Description
date string Date in the following formate YYYY-MM-DD
appKey string Application key of the app

Returns

Promise<string>

ARM data in csv format


getARMReportAsStream

getARMReportAsStream(date, appKey): Promise<Stream>

Parameters

Name Type Description
date string Date in the following formate YYYY-MM-DD
appKey string Application key of the app

Returns

Promise<Stream>

  • A stream of the ARM data from the request

getApps

getApps(): Promise<string>

Returns

Promise<string>

List of apps from the account


getInstances

getInstances(applicationKey): Promise<string>

Parameters

Name Type Description
applicationKey string Application Key to get instances for.

Returns

Promise<string>


getMediationGroups

getMediationGroups(applicationKey): Promise<string>

Parameters

Name Type Description
applicationKey string The application key to get the mediation groups for

Returns

Promise<string>


getMonetizationData

getMonetizationData(startDate, endDate, optionsParams?): Promise<string>

Parameters

Name Type Description
startDate string Report start date in the following format YYYY-MM-DD
endDate string Report end date in the following format YYYY-MM-DD
optionsParams? Object Object containing optional
optionsParams.adSource? Networks Filter for specific Ad Source - network Networks.
optionsParams.adUnits? AdUnits -
optionsParams.appKey? string -
optionsParams.breakdowns? Breakdowns[] List of breakdowns see Breakdowns see supported breakdown and metrics
optionsParams.country? string Country code in 2 letter country code, as per [ISO 3166-1 Alpha-2]
optionsParams.metrics? Metrics[] List of metrics see Metrics see supported metrics and breakdowns

Returns

Promise<string>

Report data in json format.


getPlacements

getPlacements(applicationKey): Promise<string>

Parameters

Name Type
applicationKey string

Returns

Promise<string>


getUserAdRevenue

getUserAdRevenue(date, appKey): Promise<string>

Parameters

Name Type Description
date string {string} - Date in the following formate YYYY-MM-DD
appKey string {string} - Application key of the app

Returns

Promise<string>

UAR data in csv format


getUserAdRevenueAsStream

getUserAdRevenueAsStream(date, appKey): Promise<Stream>

Parameters

Name Type Description
date string {string} - Date in the following formate YYYY-MM-DD
appKey string {string} - Application key of the app

Returns

Promise<Stream>

  • A stream of the UAR data from the request

updateInstance

updateInstance(applicationKey, instances): Promise<string>

Parameters

Name Type Description
applicationKey string Application key to update instance for.
instances InstanceConfig[] List of Instance Configs InstanceConfig

Returns

Promise<string>


updateMediationGroup

updateMediationGroup(applicationKey, groupId, groupOptions?): Promise<string>

Parameters

Name Type Description
applicationKey string The application key to update the group for.
groupId number Id of the group to update
groupOptions? Object Optional group parameters
groupOptions.adSourcePriority? MediationGroupPriority AdSource and their priority
groupOptions.groupCountries? string[] List of group countries in ISO 3166-1 Alpha-2
groupOptions.groupName? string Group name
groupOptions.groupPosition? number Position of the group in the group list
groupOptions.groupSegments? number Segment ID attached to the group

Returns

Promise<string>


updatePlacements

updatePlacements(applicationKey, placements): Promise<string>

Parameters

Name Type
applicationKey string
placements Placement[]

Returns

Promise<string>

InstanceConfig

AdColonyBidding

constructor

new AdColonyBidding(instanceName, adUnit, status, appId, zoneId, options?)

Parameters
Name Type
instanceName string
adUnit AdUnits
status boolean
appId string
zoneId string
options? Object
options.instanceId? number
options.rate? number

AdColonyInstance

constructor

new AdColonyInstance(instanceName, adUnit, status, appId, zoneId, options?)

Parameters
Name Type
instanceName string
adUnit AdUnits
status boolean
appId string
zoneId string
options? Object
options.instanceId? number
options.rate? number

AdManagerInstance

constructor

new AdManagerInstance(instanceName, instanceAdUnit, status, appId, adUnitId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
adUnitId string
options? Object
options.instanceId? number
options.rate? number

AdMobInstance

constructor

new AdMobInstance(instanceName, instanceAdUnit, status, appId, adUnitId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
adUnitId string
options? Object
options.instanceId? number
options.rate? number

AmazonInstance

constructor

new AmazonInstance(instanceName, instanceAdUnit, status, appKey, ec, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appKey string
ec string
options? Object
options.instanceId? number
options.rate? number

ApplovinInstance

constructor

new ApplovinInstance(instanceName, adUnit, status, sdkKey, zoneId, options?)

Parameters
Name Type
instanceName string
adUnit AdUnits
status boolean
sdkKey string
zoneId string
options? Object
options.instanceId? number
options.rate? number

CJSInstance

constructor

new CJSInstance(instanceName, instanceAdUnit, status, appId, slotId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId number
slotId number
options? Object
options.instanceId? number
options.rate? number

ChartboostInstance

constructor

new ChartboostInstance(instanceName, instanceAdUnit, status, appId, appSignature, adLocation, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
appSignature string
adLocation string
options? Object
options.instanceId? number
options.rate? number

CrossPromotionBiddingInstance

constructor

new CrossPromotionBiddingInstance(instanceName, instanceAdUnit, status, trafficId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
trafficId number
options? Object
options.instanceId? number
options.rate? number

DirectDealsInstance

constructor

new DirectDealsInstance(instanceName, instanceAdUnit, status, trafficId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
trafficId number
options? Object
options.instanceId? number
options.rate? number

FacebookBiddingInstance

constructor

new FacebookBiddingInstance(instanceName, instanceAdUnit, status, appId, userAccessToken, placementId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
userAccessToken string
placementId string
options? Object
options.instanceId? number
options.rate? number

FacebookInstance

constructor

new FacebookInstance(instanceName, instanceAdUnit, status, appId, userAccessToken, placementId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
userAccessToken string
placementId string
options? Object
options.instanceId? number
options.rate? number

FyberInstance

constructor

new FyberInstance(instanceName, instanceAdUnit, status, appId, adSpotId, contentId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
adSpotId string
contentId string
options? Object
options.instanceId? number
options.rate? number

HyperMXInstance

constructor

new HyperMXInstance(instanceName, instanceAdUnit, status, placementId, distributorId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
placementId string
distributorId string
options? Object
options.instanceId? number
options.rate? number

InMobiBiddingInstance

constructor

new InMobiBiddingInstance(instanceName, instanceAdUnit, status, placementId, adSource, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
placementId string
adSource Networks
options? Object
options.instanceId? number
options.rate? number

InMobiInstance

constructor

new InMobiInstance(instanceName, instanceAdUnit, status, placementId, adSource, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
placementId string
adSource Networks
options? Object
options.instanceId? number
options.rate? number

IronSourceBidding

constructor

new IronSourceBidding(instanceName, adUnit, applicationKey, status, instanceId?)

Parameters
Name Type Default value
instanceName string undefined
adUnit AdUnits undefined
applicationKey string undefined
status boolean undefined
instanceId number -1

IronSourceInstance

constructor

new IronSourceInstance(instanceName, adUnit, applicationKey, status, options?)

Parameters
Name Type
instanceName string
adUnit AdUnits
applicationKey string
status boolean
options? Object
options.instanceId? number
options.pricing? Map<number, string[]>

LiftoffInstance

constructor

new LiftoffInstance(instanceName, instanceAdUnit, status, appId, adUnitId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
adUnitId string
options? Object
options.instanceId? number
options.rate? number

MaioInstance

constructor

new MaioInstance(instanceName, instanceAdUnit, status, appId, mediaId, zoneId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
mediaId string
zoneId string
options? Object
options.instanceId? number
options.rate? number

MyTargetInstance

constructor

new MyTargetInstance(instanceName, instanceAdUnit, status, slotId, placementId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
slotId string
placementId string
options? Object
options.instanceId? number
options.rate? number

PangleBiddingInstance

constructor

new PangleBiddingInstance(instanceName, instanceAdUnit, status, appId, slotId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
slotId string
options? Object
options.instanceId? number
options.rate? number

PangleInstance

constructor

new PangleInstance(instanceName, instanceAdUnit, status, appId, slotId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
slotId string
options? Object
options.instanceId? number
options.rate? number

SmaatoInstance

constructor

new SmaatoInstance(instanceName, instanceAdUnit, status, applicationName, adSpaceID, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
applicationName string
adSpaceID string
options? Object
options.instanceId? number
options.rate? number

SnapInstance

constructor

new SnapInstance(instanceName, instanceAdUnit, status, appId, slotId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
slotId string
options? Object
options.instanceId? number
options.rate? number

SuperAwesomeInstance

constructor

new SuperAwesomeInstance(instanceName, instanceAdUnit, status, appID, placementId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appID string
placementId string
options? Object
options.instanceId? number
options.rate? number

TapJoyBiddingInstance

constructor

new TapJoyBiddingInstance(instanceName, instanceAdUnit, status, sdkKey, apiKey, placementName, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
sdkKey string
apiKey string
placementName string
options? Object
options.instanceId? number
options.rate? number

TapJoyInstance

constructor

new TapJoyInstance(instanceName, instanceAdUnit, status, sdkKey, apiKey, placementName, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
sdkKey string
apiKey string
placementName string
options? Object
options.instanceId? number
options.rate? number

TencentInstance

constructor

new TencentInstance(instanceName, instanceAdUnit, status, appID, placementId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appID string
placementId string
options? Object
options.instanceId? number
options.rate? number

UnityAdsInstance

constructor

new UnityAdsInstance(instanceName, instanceAdUnit, status, sourceId, zoneId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
sourceId string
zoneId string
options? Object
options.instanceId? number
options.rate? number

VungleBiddingInstance

constructor

new VungleBiddingInstance(instanceName, instanceAdUnit, status, appId, reportingApiId, placementId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
reportingApiId string
placementId string
options? Object
options.instanceId? number
options.rate? number

VungleInstance

constructor

new VungleInstance(instanceName, instanceAdUnit, status, appId, reportingApiId, placementId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
appId string
reportingApiId string
placementId string
options? Object
options.instanceId? number
options.rate? number

YahooBiddingInstance

constructor

new YahooBiddingInstance(instanceName, instanceAdUnit, status, siteId, placementId, options?)

Parameters
Name Type
instanceName string
instanceAdUnit AdUnits
status boolean
siteId string
placementId string
options? Object
options.instanceId? number
options.rate? number

Class: MediationGroupPriority

constructor

new MediationGroupPriority()

Methods

getBidders

getBidders(): undefined | MediationGroupTier

Returns groups bidders list

Returns

undefined | MediationGroupTier

or undefined.


getTiers

getTiers(): (undefined | MediationGroupTier)[]

Returns groups tiers list

Returns

(undefined | MediationGroupTier)[]

or undefined.


removeBidders

removeBidders(): void

Removes bidders from the group

Returns

void


removeTier

removeTier(position): void

Removes tier from the group

Parameters

Name Type Description
position number position of the tier to be removed (0-2)

Returns

void


setMediationGroupTier

setMediationGroupTier(groupTier, position): boolean

set the mediation group with a tier.

Parameters

Name Type Description
groupTier MediationGroupTier MediationGroupTier to be added to the group tier list
position number The Position of the tier (0-2), Ignored in case of bidding tier.

Returns

boolean

  • true upon successful addition of the tier to the group list.

Class: MediationGroupTier

Constructors

constructor

new MediationGroupTier(tierType)

Parameters

Name Type Description
tierType TIER_TYPE the type of tier

Methods

addInstances

addInstances(network, instanceId, optionalParams?): void

Adds an instance to the tier.

Parameters

Name Type Description
network Networks Network name
instanceId number ID of the instance for the network (see MonetizeAPI().getInstanceIds())
optionalParams? Object Optional parameters
optionalParams.capping? number Optional: Set capping for the instance per session
optionalParams.position? number Optional: The position of the instance in the waterfall, only for Manual tier type
optionalParams.rate? number Optional: overrides the cpm of the instance with rate

Returns

void


getInstanceList

getInstanceList(): any

Returns list of instances in the tier

Returns

any


getTierType

getTierType(): TIER_TYPE

returns the tier type

Returns

TIER_TYPE


removeInstance

removeInstance(network, instanceID): void

Removes instance from the tier.

Parameters

Name Type Description
network Networks The network of the instance to remove.
instanceID number Instance ID to remove.

Returns

void


toString

toString(): any

building tier object for sending to the API.

Returns

any

Class: Placement

Methods

constructor

new Placement(adUnit, enabled?, options?)

Parameters

Name Type Default value Description
adUnit AdUnits undefined The placement Ad Unit.
enabled boolean true Placement enabled.
options? Object undefined -
options.capping? Capping undefined Optional: capping for placement.
options.itemName? string undefined Placement item name - mandatory for Rewarded Video.
options.name? string undefined -
options.pacing? Pacing undefined Optional: pacing for placement.
options.placementId? number undefined Optional: Placement id for update and delete operations.
options.rewardAmount? number undefined Placement reward amount - mandatory for Rewarded Video.

Methods

getAdUnit

getAdUnit(): AdUnits

Returns

AdUnits


getCapping

getCapping(): undefined | Capping

Returns

undefined | Capping


getItemName

getItemName(): undefined | string

Returns

undefined | string


getName

getName(): undefined | string

Returns

undefined | string


getPacing

getPacing(): undefined | Pacing

Returns

undefined | Pacing


getPlacementId

getPlacementId(): undefined | number

Returns

undefined | number


getRewardAmount

getRewardAmount(): undefined | number

Returns

undefined | number


isEnabled

isEnabled(): boolean

Returns

boolean

Class: Capping

Methods

constructor

new Capping(limit, interval, enabled)

Parameters

Name Type Description
limit number Capping limit max 1000
interval "d" | "h" Capping interval: d – days or h – hours
enabled boolean Capping enabled.

Methods

getInterval

getInterval(): string

Returns

string


getLimit

getLimit(): number

Returns

number


isEnabled

isEnabled(): boolean

Returns

boolean

Class: Pacing

Methods

constructor

new Pacing(minutes, enabled)

Parameters

Name Type Description
minutes number Placement pacing in minutes max 1000
enabled boolean Placement enabled.

Methods

getMinutes

getMinutes(): number

Returns

number


isEnabled

isEnabled(): boolean

Returns

boolean

Enums:

Enum: AdUnitStatus

MonetizeEnums.AdUnitStatus

Enum Members

Live

Live = "Live"


Off

Off = "Off"


Test

Test = "Test"

Enum: AdUnits

MonetizeEnums.AdUnits

Enum Members

Banner

Banner = "banner"


Interstitial

Interstitial = "interstitial"


Offerwall

Offerwall = "OfferWall"


RewardedVideo

RewardedVideo = "rewardedVideo"

Enum: Breakdowns

MonetizeEnums.Breakdowns

Enum Members

ABTest

ABTest = "abTest"


ATT

ATT = "att"


AdUnits

AdUnits = "adUnits"


AppVersion

AppVersion = "appVersion"


Application

Application = "app"


ConnectionType

ConnectionType = "connectionType"


Country

Country = "country"


Date

Date = "date"


IDFA

IDFA = "idfa"


IOSVersion

IOSVersion = "iosVersion"


Instance

Instance = "instance"


Network

Network = "adSource"


Placement

Placement = "placement"


Platform

Platform = "platform"


SDKVersion

SDKVersion = "sdkVersion"


Segment

Segment = "segment"

Enum: Metrics

MonetizeEnums.Metrics

Enum Members

activeUsers

activeUsers = "activeUsers"


adSourceAvailabilityRate

adSourceAvailabilityRate = "adSourceAvailabilityRate"


adSourceChecks

adSourceChecks = "adSourceChecks"


adSourceResponses

adSourceResponses = "adSourceResponses"


appFillRate

appFillRate = "appfillrate"


appFills

appFills = "appFills"


appRequests

appRequests = "appRequests"


clickThroughRate

clickThroughRate = "clickThroughRate"


clicks

clicks = "clicks"


completionRate

completionRate = "completionRate"


completions

completions = "completions"


eCPM

eCPM = "ecpm"


engagedSessions

engagedSessions = "engagedSessions"


engagedUsers

engagedUsers = "engagedUsers"


engagedUsersRate

engagedUsersRate = "engagedUsersRate"


impressionPerEngagedSessions

impressionPerEngagedSessions = "impressionPerEngagedSessions"


impressions

impressions = "impressions"


impressionsPerEngagedUser

impressionsPerEngagedUser = "impressionsPerEngagedUser"


impressionsPerSession

impressionsPerSession = "impressionsPerSession"


revenue

revenue = "revenue"


revenuePerActiveUser

revenuePerActiveUser = "revenuePerActiveUser"


revenuePerCompletion

revenuePerCompletion = "revenuePerCompletion"


revenuePerEngagedUser

revenuePerEngagedUser = "revenuePerEngagedUser"


sessions

sessions = "sessions"


sessionsPerActiveUser

sessionsPerActiveUser = "sessionsPerActiveUser"


useRate

useRate = "useRate"

Enum: Networks

MonetizeEnums.Networks

Enum Members

AdColony

AdColony = "AdColony"


AdColonyBidding

AdColonyBidding = "adColonyBidding"


AdManager

AdManager = "AdManager"


AdMob

AdMob = "AdMob"


Amazon

Amazon = "Amazon"


AppLovin

AppLovin = "AppLovin"


CSJ

CSJ = "CSJ"


Chartboost

Chartboost = "Chartboost"


CrossPromotionBidding

CrossPromotionBidding = "crossPromotionBidding"


DirectDeals

DirectDeals = "DirectDeals"


Facebook

Facebook = "Facebook"


FacebookBidding

FacebookBidding = "facebookBidding"


Fyber

Fyber = "Fyber"


HyperMX

HyperMX = "HyprMX"


InMobi

InMobi = "InMobi"


InMobiBidding

InMobiBidding = "inMobiBidding"


IronSource

IronSource = "ironSource"


IronSourceBidding

IronSourceBidding = "ironSourceBidding"


LiftOff

LiftOff = "Liftoff Bidding"


Maio

Maio = "Maio"


MyTarget

MyTarget = "myTargetBidding"


Pangle

Pangle = "Pangle"


PangleBidding

PangleBidding = "pangleBidding"


Smaato

Smaato = "smaatoBidding"


Snap

Snap = "Snap"


SuperAwesome

SuperAwesome = "SuperAwesomeBidding"


TapJoy

TapJoy = "TapJoy"


TapJoyBidding

TapJoyBidding = "TapJoyBidding"


Tencent

Tencent = "Tencent"


UnityAds

UnityAds = "UnityAds"


Vungle

Vungle = "Vungle"


VungleBidding

VungleBidding = "vungleBidding"


YahooBidding

YahooBidding = "yahooBidding"

Enum: PLATFORM

MonetizeEnums.PLATFORM

Enum Members

Android

Android = "Android"


iOS

iOS = "iOS"

Enum: TIER_TYPE

Enum Members

BIDDERS

BIDDERS = "bidding"


MANUAL

MANUAL = "manual"


OPTIMIZED

OPTIMIZED = "optimized"


SORT_BY_CPM

SORT_BY_CPM = "sortByCpm"