|
Note: This feature will not function unless we have enabled it for your game. If you would like to have this feature enabled, please email us at apps@kongregate.com.
Kongregate Advertising APIKongregate's Advertising API allows you to request and display interstitial ads during pauses in gameplay. The ads are incentivized with in-game rewards, which increases engagement and revenue. The Advertising API is available via the AS3 and Javascript interfaces. Overview
The advertising API can be accessed via the Initializing
Once your game is ready to display ads, you can set up your event listeners for various events and then call
kongregate.mtx.addEventListener("adsAvailable", function(e:Event):void{
// Ads are now available, calls to kongregate.mtx.showIncentivizedAd() will work
});
kongregate.mtx.addEventListener("adsUnavailable", function(e:Event):void{
// Ads are no longer available, calls to kongregate.mtx.showIncentivizedAd() will fail
});
kongregate.mtx.addEventListener("adOpened", function(e:Event):void{
// An ad is being displayed
});
kongregate.mtx.addEventListener("adCompleted", function(e:Event):void{
// An ad has completed successfully, and the player should be rewarded
});
kongregate.mtx.addEventListener("adAbandoned", function(e:Event):void{
// Ad ad has been closed before completion, the player should not be rewarded
});
kongregate.mtx.initializeIncentivizedAds();
Displaying Incentivized AdsOnce you have received theadsAvailable notification, you can call kongregate.mtx.showIncentivizedAd() to request an incentivized ad. If an ad is successfully displayed, you will receive an adOpened event, at which point you should pause gameplay and mute sound until either adCompleted or adAbandoned is received. Subsequent calls to showIncentivizedAd() should succeed until the adsUnavailable event is fired.
|