HTML App Mobile Banner/Interstitial
HTML App Mobile Banner and HTML App Mobile Interstitial are banners that display HTML creatives in mobile apps.
- Project example in Adobe Animate CC.
- Project example in Google Web Designer.
Develop an HTML creative
Make sure your HTML code meets the following requirements.
HTML Code Requirements
-
The maximum size of an HTML file is 65 000 bytes.
-
It's best to place JavaScript and CSS inside the HTML code of the banner. If the final HTML code exceeds the maximum acceptable size, reduce it by splitting JavaScript and CSS code into separate files:
-
Save the JS and CSS code in separate files with the .js or .css extension.
-
File weight can't be more than 300 KB.
-
To connect additional files (images, styles, scripts), use absolute links:
src="js/script.js",src="css/style.css". Adfox identifies the file paths, automatically uploads them to the Files tab, and replaces all references to the files in the project you upload.Don't use relative links:
src="../js/script.js".Example of connecting JS and CSS files:
<script type="text/javascript" src="LINK_TO_FILE"></script><link rel="stylesheet" type="text/css" href="LINK_TO_FILE" />
-
-
The project can contain only one file with the .html extension.
-
The maximum number of files in a single project is 50.
-
File types allowed in the project: CSS, JS, HTML, GIF, PNG, JPG, JPEG, SVG, JSON, FLV, MP4, OGV, OGG, WEBM, AVI, and SWF.
-
The maximum size of each file (this applies to archived files as well):
- 300 KB.
- 1 MB for video files.
-
File names must only contain numbers or Latin letters and an underscore character. You can't use Cyrillic letters, spaces, quotation marks, or special characters in the file name.
-
You can't use Cyrillic letters in the names of variables and objects. The only exception is text on the banner.
-
The completed project is a ZIP archive.
Image requirements
- Maximum file size: 300 KB.
- Allowed image formats: PNG, GIF, JPG, and SVG.
- Make sure to use high-resolution images: this will improve the banner's display quality on mobile devices. However, this might also make it take longer to load.
- To reduce image size, you can use services such as TinyPng, which supports PNG and JPEG files.
- You can use images in SVG format: they have a small file size, support animations, and are vector-based, which means they look better on any device, whether it's a desktop or a smartphone.
Select the editing software for your HTML creative. Make sure to put your HTML creative into an archive according to the following instructions:
Adobe Animate CC
-
Download a banner template with a single clickable area (button) for Adobe Animate CC version 16.0 or higher.
-
Create an HTML5 Canvas project in Adobe Animate (or open an existing one).

-
Open the publication settings in File → Publish Settings and use the template from step 1.

-
Select a folder and publish your project.

-
The entire banner area is clickable: it's a button that leads to the advertiser's site. The link is pulled into the creative from the banner settings in Adfox.
Google Web Designer editor
-
Download a banner template for Google Web Designer.
You can use this banner's code when making creatives in the editor. Place the archive contents into the folder with the program templates, for example:
/Users/[USER_NAME]/Documents/Google Web Designer/templates
The template contains an
adfox_HTML5.jsscript and a set of parameters for click-throughs and event counters to work correctly:%request.reference_mrc%, %user2%, %eventN%, where N is the event number from 4 to 30. -
Click processing.
All events are assigned to animation elements on the Events tab.


Actions are called using the Interactive area component.
Add it and select the event Tap Area → Touch/Click.


On the Custom code tab, select the call of the click function:
-
callClick(): if a single button is used. -
callClick(n): used if there are multiple clickable buttons. -
callEvent(n): used for when you need to call an event from an animation without clicking.
Where
nis the number of the event to be called.


How to use a stretching (adaptive) banner
To make the banner stretch across the width of the container on the site, specify percentages instead of pixels for the banner location and dimensions on the Свойства panel.

Use the Выровнять по контейнеру and Резиновый макет options on the top toolbar.
If you enable Резиновый макет before using any alignment tools, when you change the parent container size, all elements are aligned relative to each other and relative to the container size.
You can use the relative element sizes in percentages and absolute sizes in pixels at the same time.
Project example in Google Web Designer.
-
-
Publish the project with the following settings:

- Inline local files enabled.
- Create ZIP enabled.
- Group unpacking enabled.
- CSS prefix is enabled for WebKit and Mozilla.
Note
When adding a banner to Adfox, make sure to tell the manager which buttons match which events. For each event, the manager adds a unique link, which is then passed to the banner code as a variable.
After publishing the project, archive it with the .zip extension. Your creative is ready to be uploaded to the Adfox banner.
Other editors
Click counters in banners
If you want your Adfox banner to display click statistics, find the a tag for the href attribute in your HTML code and add the following variable: %banner.reference_mrc_user2%.
For links, use the target attribute with the %banner.target% variable as an attribute. If the attribute is missing, the link will open inside the iframe: that is, the advertised site will open in the location of the banner.
Example of HTML code that counts banner clicks:
<a href="%banner.reference_mrc_user2%" target="%banner.target%">Advertiser's website</a>
Counting clicks for multiple links in the banner
Let's say the banner has several links leading to different pages of the advertised site, and you need to count the number of clicks for each of them.
<a href="http://site.com" target="_blank">First link</a>
<a href="http://site.com/about/" target="_blank">Second link</a>
Replace the href attribute values with the %request.reference_mrc@%banner.eventN% variables, where N is the event number from 4 to 28. For example:
<a href="%request.reference_mrc%@%banner.event4%" target="%banner.target%">First link</a>
<a href="%request.reference_mrc%@%banner.event5%" target="%banner.target%">Second link</a>
Make sure to inform the manager handling Adfox banner integration which links match which variables. When adding a banner via the Events tab, specify the following information:
-
First link:
http://site.com — %banner.event4%for Event 4. -
Second link:
http://site.com/about/ — %banner.event5%for Event 5.
Add a banner to Adfox
To add a banner to Adfox:
-
In the campaign settings, go to Banners and click Create.
-
Select the banner type App Mobile Banner or App Mobile Interstitial and template HTML App Mobile Banner or HTML App Mobile Interstitial respectively.
-
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.
-
Archive with creative HTML5 content: Upload a ZIP archive with the project. Leave the HTML5 field empty: it's filled with the contents of your project's HTML file after you add the banner.
-
Tracking pixel link: By default, the Adfox
//banners.adfox.ru/transparent.gifpixel is used. If you want to count impressions in a third-party system, delete the Adfox pixel and provide another link. -
HTML5: If you uploaded a project archive, this field is filled out automatically.
-
Transition URL: Enter a link to the advertiser's site. For the click-through to work correctly, make sure that the link includes the protocol (
http://orhttps://). -
Time until the сlose "X" appears: Set a delay before the close button appears in seconds. Allowed values: from 0 to 15 seconds. If the value is 0, the close button appears immediately. If the value isn't set or is specified incorrectly, the standard Mobile Ads SDK behavior is used.
-
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.
-
Ad label: Select Ad or Social Ad to add a label to the banner. If your ad creative already contains a label, you can leave the Disabled value in the drop-down list.
Note
Adding the Social Ad label doesn't automatically define the creative as a social ad. To label a creative as a social ad in the state register, select Social ads contract for the corresponding contract with the end advertiser.
-
Domain: Specify the advertiser domain to add it to the label:
Ad / Example.comorSocial ad / Example.com(only if the Ad or Social Ad value is selected in the drop-down list). -
Show banner menu: Enable this option to add a token to a non-clickable banner. When serving the banner, it will have the menu icon displayed in the upper-right corner. When a user clicks the icon, the advertiser's details and the copy token button appear (if ad register is enabled for the banner or a third-party token is specified).
The banner menu contains a link to the rules for using recommendation technologies. It's required for compliance with Clause 3 of Section 1 of Article 10.2-2 of the Federal Law No. 149-FZ “On information, information technologies, and information protection”, dated July 27, 2006.
Note
If the banner needs to be labeled, you can enable the banner menu to make the token available when the banner is served to users.
-
Settings for Russian ad register: This section is only available if you've selected Advertising labeling as a labeling procedure in the campaign settings. Fill in the fields in this section to register the creative in the Yandex advertising data operator. The creative is assigned a token automatically. For more information about labeling ads, see Adfox Help.
-
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 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.