Type Function
Return value none
Revision 2019.3540
Keywords ads, advertising, SuperAwesome, load
See also


Preloads a SuperAwesome ad. You can also call superawesome.isLoaded() to verify that the ad has been loaded and to show it.


superawesome.load( adUnitType, params )
adUnitType (required)

String. The type of ad according to the SuperAwesome placement ID. Supported values are "banner", "interstitial", or "video".

params (required)

Table. Table containing customization parameters for the specified ad type — see the next section for details.

Parameter Reference

The params table containing customization parameters for the specified ad type.

placementId (required)

String. The placement ID for the ad to be loaded, retrieved from the SuperAwesome dashboard.

bannerSize (optional)

String. The size of the banner ad. Valid options include "BANNER_50", "BANNER_90", and "BANNER_250". Default is "BANNER_50".

bannerTransparency (optional)

Boolean. Specifies if the banner background should be transparent. Default is false.


local superawesome = require( "plugin.superawesome" )

-- Pre-declare a placement ID
local myPlacementID = "YOUR_PLACEMENT_ID"

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        -- Load a banner ad
        superawesome.load( "banner", { placementId=myPlacementID } )

    elseif ( event.phase == "loaded" ) then  -- The ad was successfully loaded
        print( event.type )
        print( event.placementId )

    elseif ( event.phase == "failed" ) then  -- The ad failed to load
        print( event.type )
        print( event.placementId )
        print( event.isError )

-- Initialize the SuperAwesome plugin
superawesome.init( adListener, { testMode=true } )