App Native Slider
Warning
This ad template is deprecated. Use App Native Carousel instead.
App Native Slider is a slider of related ads that follows the native ads principle. You can customize the ad depending on the functions and design of the app the slider will be displayed in.
Example of a App Native Slider ad:

Image requirements
- Make sure to use high-resolution images: this will improve the banner's display quality on mobile devices, but might also take it longer to load.
- We recommend reducing the image file size using a file compression service, such as TinyPNG.
- Acceptable image formats: PNG, GIF (without animation), JPG.
- The maximum size of a single file is 300 KB.
Create a native banner
-
Decide which native elements you want to include in the banner.
-
Prepare the JSON code. Specify the parameters that you want to customize (ad elements and their values) in the code.
JSON example
{ "content": [ "text", "button" ], "text": { "value": "Customizable text from an Adfox ad unit" }, "button": { "label": "Custom button", "link": "https://ya.ru/", "backgroundColor": "#5D9B9B" } }To pass the click-through URL for JSON elements of the banner, use the macro:
%banner.reference_mrc_user1%. The system will count the banner click and redirect the user to the advertiser's site specified in the Transition URL parameter. -
Write your JSON in one line and use the
\character to escape quotes.JSON example with escaped quotes
{ \"content\": [ \"text\", \"button\" ], \"text\": { \"value\": \"Customizable text from an Adfox ad unit\" }, \"button\": { \"label\": \"Custom button\", \"link\": \"https:\/\/ya.ru\/\", \"backgroundColor\": \"#5D9B9B\" } -
To ensure correct display of native elements in your app, add support for reading JSON data on the app side. Note that each native ad element specified in JSON must be properly implemented in the app code.
Example of parsing JSON data (Kotlin)
private fun processAdditionalText(rawJson: String) { try { val jsonObject = JSONObject(rawJson) val contentJSONArray = jsonObject.getJSONArray("content") repeat(contentJSONArray.length()) { index -> val elementName = contentJSONArray.getString(index) val elementConfiguration = jsonObject.getJSONObject(elementName) when (elementName) { "text" -> addTextToLayout(elementConfiguration, index) "button" -> addButtonToLayout(elementConfiguration, index) } } } catch (e: JSONException) { adInfoFragment.log(e.message ?: "JSON parsing error") } } private fun addTextToLayout(textConfiguration: JSONObject, index: Int) { val textView = TextView(this).apply { setPadding(resources.getDimension(R.dimen.item_padding).toInt()) text = textConfiguration.getString("value") } additionalContainer.addView(textView, index) } private fun addButtonToLayout(buttonConfiguration: JSONObject, index: Int) { val buttonView = Button(this).apply { setPadding(resources.getDimension(R.dimen.item_padding).toInt()) text = buttonConfiguration.getString("label") val colorHex = buttonConfiguration.getString("backgroundColor") setBackgroundColor(Color.parseColor(colorHex)) setOnClickListener { val link = buttonConfiguration.getString("link") val intent = Intent(Intent.ACTION_VIEW, Uri.parse(link)) startActivity(intent) } } additionalContainer.addView(buttonView, index) } -
Add the banner following the instructions below.
Stages of native banner preparation

Add a banner to Adfox
To add a banner:
-
In the campaign settings, go to Banners and click Add.
-
Choose the App Mobile Native banner type and the App Native Slider template.
-
Set the banner parameters:
CommonAdvanced-
Priority: The banner's display order in the campaign. The higher the numeric value, the higher the banner's priority over the other banners in the same campaign. For more information on priorities, see Adfox Help.
-
Slide N: image (where N is the slide number): The slide image.
-
Slide N: click-through web link (where N is the slide number): The URL of the advertiser's site. For the click to work correctly, make sure link contains the protocol (
http://orhttps://). If the user hasn't installed the app, this link is called instead of a link to a deeplink. -
Slide N: Deeplink (where N is the slide number): The URL that redirects the user to a specific page in the iOS or Android app.
-
Slide N: Android BundleID (where N is the slide number): The app ID in Google Play, required for the deeplink to work on Android devices. Example:
ru.yandex.searchplugin. -
Width: The slider width. Enter only an integer in pixels, without specifying the dimension.
-
Height: The slider height. Enter only an integer in pixels, without specifying the dimension.
-
Additional text: If you need to add custom elements to ads or creatives, use the JSON code you prepared.
Example of the Additional text field

-
Slide set: Use this field to adjust the number and type of slides. Add to it a list of variables that look like
%global.InAppSlideN%(for slides that don't contain a deeplink) and%global.InAppSlideDeeplinkN%(for slides with a deeplink), where N is the slide number.Example of filling out fields for a slider that consists of three slides with deeplinks
%global.InAppSlideDeeplink1% %global.InAppSlideDeeplink2% %global.InAppSlideDeeplink3% -
Start date and time: Required parameters. By default, this is the current date. If you don't change the default value, banners are served immediately after you add them if the banner status is active.
-
Name: Enter a banner name of your choice. If you leave this box empty, the banner is assigned a number.
-
Status: Select a banner status:
- active: Banner is ready to be served.
- paused: Banner impressions have been temporarily stopped.
- completed: Banner won't generate impressions.
-
Disabled on new placements: Enabled by default. Once you create your banner, it won't be placed automatically:
- Newly-created placements within the site or section where the campaign is running.
- Placements enabled in the campaign placement settings after the banner is created. If you disable this option, the banner is automatically delivered to all the placements enabled for this campaign.
-
Targeting profile: Select the targeting profile you created earlier. To learn more about targeting profiles, see Adfox Help.
-
Events enabled: Use this parameter to get direct links to events so they can be measured in a third-party system. To enable this option, go to the Placements tab for the banner and click
. In the window that opens, there are links to events from 1 to 30 that you need to copy and send to a third-party system for installation. -
Impressions in total, day, hour:
- Impressions total, day, hour: Maximum number of banner impressions. If the campaign has evenly distributed traffic, set the end date for impressions on this banner. When the number of impressions reaches the limit, the banner status changes to completed and the banner is no longer served.
- Impressions per day: Maximum number of impressions per day. When the number of impressions served since the beginning of the day reaches the limit, all impressions stop until the next day.
- Impressions per hour: Maximum number of impressions per hour. When the number of impressions since the beginning of the hour reaches the limit, all impressions stop until the next hour.
-
Clicks total, per day, per hour:
- Clicks total: Maximum number of banner clicks. If the campaign has evenly distributed traffic, set the end date for impressions on this banner. When the number of clicks reaches the limit, the banner status changes to completed and the banner is no longer served.
- Clicks per day: Maximum number of banner clicks per day. When the number of clicks since the beginning of the day reaches the limit, all impressions stop until the next day.
- Clicks per hour: Maximum number of impressions per hour. When the number of clicks since the beginning of the hour reaches the limit, all impressions stop until the next hour.
-
End time: To set the end date and time, first enable the option.
-
-
To save the banner, click Add.
You can set links for measurement in banner events:
- A slider impression tracking pixel: Counts the number of impressions for the entire slider.
- An N slide impression tracking pixel(where N is the slide number): Counts the number of impressions for the slide N.
- The number of clicks for slide N (where N is the slide number): Counts clicks for slide N. The overall click statistics show total clicks for all slides.