-
Notifications
You must be signed in to change notification settings - Fork 0
Native Ads
- 1. Register a placement tag
- 2. Load the native ad
- 3. Get the native ad
- 4. Sending the impression and click
For your app to receive any cross promo ads, the app must specify which CreativeTypes for each tag it uses when initialising the SDK.
// create a config
var config:TapdaqConfig = new TapdaqConfig(APPLICATION_ID, CLIENT_KEY);
// Setup the placements with ad types your app will use
var placements:Array = [
new Placement([TapdaqCreativeType.SQUARE_SMALL],PlacementTag.MAIN_MENU)
];
// register placements in config
config.withPlacementTagSupport(placements);
// init Tapdaq ANE
_tapdaq = Tapdaq.init(config);First we have to load the native ad:
_tapdaq.loadNativeAd(TapdaqCreativeType.SQUARE_SMALL, PlacementTag.MAIN_MENU);We should receive the TapdaqAdEvent.AD_LOADED event
First we have to make sure we have the listener for the native ad data:
_tapdaq.addEventListener(TapdaqNativeAdDataEvent.AD_DATA, onNativeAdData);And we can get the native ad data:
_tapdaq.getNativeAd(TapdaqCreativeType.SQUARE_SMALL, PlacementTag.MAIN_MENU);private function onNativeAdData(event:TapdaqNativeAdDataEvent):void {
_uiView.logInConsole("Tapdaq Native Ad event: ");
_uiView.logInConsole("Ad::appName " + event.nativeAd.appName);
_uiView.logInConsole("Ad::ageRating " + event.nativeAd.ageRating);
_uiView.logInConsole("Ad::appVersion " + event.nativeAd.appVersion);
_uiView.logInConsole("Ad::appSize " + event.nativeAd.appSize);
_uiView.logInConsole("Ad::averageReview " + event.nativeAd.averageReview);
_uiView.logInConsole("Ad::callToActionText " + event.nativeAd.callToActionText);
_uiView.logInConsole("Ad::category " + event.nativeAd.category);
_uiView.logInConsole("Ad::currency " + event.nativeAd.currency);
_uiView.logInConsole("Ad::description " + event.nativeAd.description);
_uiView.logInConsole("Ad::developerName " + event.nativeAd.developerName);
_uiView.logInConsole("Ad::iconUrl " + event.nativeAd.iconUrl);
_uiView.logInConsole("Ad::imageUrl " + event.nativeAd.imageUrl);
_uiView.logInConsole("Ad::price " + event.nativeAd.price);
_uiView.logInConsole("Ad::title " + event.nativeAd.title);
_uiView.logInConsole("Ad::totalReviews " + event.nativeAd.totalReviews);
var nativeAd:TapdaqNativeAd = event.nativeAd;
}When you display a Native Ad you should call triggerDisplay() on the received native ad for the impression to register:
nativeAd.triggerDisplay();Within your touch listener for you Native Ad, you should call triggerClick() for the click action to occur, this will likely take the user to a webpage or Play Store.
nativeAd.triggerClick();If you are having any problems integrating, feel free to contact us on support@tapdaq.com and we will be more than happy to help.
Now that you have successfully integrated a native ad into your app, what would you like to do next?