Screenglide HTML5

Description

Screenglide HTML5 is an interactive HTML5 banner that expands depending on the user's actions (click, hover, and so on) or automatically, with shifting or moving content on top of it. In the banner, you can implement buttons that lead to different pages of the advertiser's site.

The creative in the banner can be implemented in one of the following forms:

  • Images.
  • HTML creative prepared in the editor following the manual.

Parameters for adding a banner to Adfox:

  • The duration of banner impression in the expanded state.
  • Content shift during expand.

Sample banner

Sample ready-made project in Adobe Animate CC, source file.

Sample ready-made project in Google Web Designer, source file.

Develop an HTML creative

Warning

Please read the requirements for the HTML code.

  1. The maximum allowed size of an HTML file is 65,000 bytes.

  2. It's best to place JavaScript and CSS inside the HTML code of the banner. If the final HTML code exceeds the maximum allowed size, reduce it by splitting JavaScript and CSS into separate files:

    1. Save the JS and CSS code in separate files with the .js or .css extension.

    2. File weight can't be more than 300 KB.

    3. Upload the files to the Files tab of the ad campaign and embed the resulting links to the files in the HTML code.

      • If absolute links (src="js/script.js", src="css/style.css") are included in the project, then when the project is uploaded, Adfox recognizes the file paths, automatically uploads them to the Files tab, and replaces all links to these files in the uploaded project.

      • If relative links (for example, src="../js/script.js") are included in the project, use one of the following methods:

        • Replace the links to the .js and .css files with absolute links: Adfox parsing will work and all of the links will be replaced automatically.
        • Manually upload the .js and .css files to the Files tab. Then get links to these files in Adfox and replace the relative links with them in the HTML code.

      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" />
      
  3. The project can contain only one file with the .html extension.

  4. The maximum allowed number of files in a project is 50.

  5. File types allowed in the project: CSS, JS, HTML, GIF, PNG, JPG, JPEG, SVG, JSON, MP4, OGV, OGG, WEBM, AVI, and SWF.

  6. The maximum size of each file (this applies to archived files as well):

    • 300 KB.
    • 1 MB for video files.
  7. File names must only contain numbers or Latin letters and an underscore character. You can't use spaces, quotation marks, and special characters in the file name.

  8. The completed project is a ZIP archive.

When you change the canvas size, its contents are cleared in webkit browsers. Because of this, if you wrote the creative code yourself without using an editor like Adobe Animate, redraw the canvas after changing its size.

Image requirements

  • Use high-resolution images. This substantially improves banner quality on mobile devices, though it reduces banner loading speed.
  • We recommend reducing the size of image files using services like TinyPng. This service works with both PNG and JPEG.
  • You can use SVG images. These are vector images, which means they will look better on both mobile and desktop devices. They also have a small file size and can be animated.
  • Allowable image formats: PNG, GIF, JPG, SVG.
  • Maximum file size: 300 KB.

Select the editor in which you will develop the HTML creative and click on the corresponding link. Prepare an archive with an HTML creative following the instructions:

Adobe Animate CC
  1. Place two symbols on different layers that will correspond to the banner in the expanded and collapsed states.

    If you need the Close button, add it to the Movie clip of the collapsed state.

    Specify instance names.

    We recommend using instance names expanded, collapsed, and closed for the expanded, collapsed states, and the Close button accordingly. You can then transfer the code samples from this manual to Animate without changes.

    See also:

    Instructions for adding a button and assigning an instance name

    Button on the main scene

    1. Create an object on the scene, for example, using Rectangle Tool. Then select the object and select Convert to Symbol... in the context menu.

    2. In the window that appears, select Type: Button. You can leave Name unchanged. Then click Ok.

    3. For the click to work, assign an Instance Name to this button.

    4. Write the code for this button in Actions:

      window.buttons.push(
      //Separate the buttons paths with a comma, adding this first
      this.button1
      //End of button space
      );
      

    Nested button

    1. Let's say that the button is inside another symbol, for example, Movie Clip. In this example, this Movie Clip has the Instance Name “name”.

    2. Double-click to go inside name. The nested button is there.

    3. When you specify the path to this button in Actions, you need to add the object's Instance Name after this where it's nested:

      window.buttons.push(
      //Separate the buttons paths with a comma, adding this first
      this.name.button1
      //End of button space
      );
      

  2. Select one of the templates depending on the scenario in the banner. Download the template and connect it to the project:

    Templates for Animate version 15 and below:

  3. Depending on the scenario of the banner, add one of the code samples to the Actions layer:

    One clickable area and expand on hover

    //Change instance name if needed
    expanded = this.expanded;
    collapsed = this.collapsed;
    setAdfox();
    

    Multiple buttons and expand on hover

    //Change instance name if needed
    expanded = this.expanded;
    collapsed = this.collapsed;
    window.buttons.push(
    //Separate the buttons paths with a comma, adding “this” first
    this.expanded.button1, this.expanded.button2, this.expanded.button3, this.expanded.button4
    //End of button space
    );
    setAdfox();
    

    One clickable area and expand/collapse on click

    //Change instance name if needed
    expanded = this.expanded;
    collapsed = this.collapsed;
    close = this.expanded.close;
    setAdfox();
    

    Multiple buttons and expand/collapse on click

    //Change instance name if needed
    collapsed = this.collapsed;
    expanded = this.expanded;
    close = this.expanded.close;
    window.buttons.push(
    //Separate the buttons paths with a comma, adding “this” first
    this.expanded.button1, this.expanded.button2
    //End of button space
    );
    setAdfox();
    
  4. Publish the project and package it in a ZIP archive.

  5. If you use the option with multiple buttons, make sure to keep track of instance names of the buttons and their corresponding purpose. You'll need this information when adding an HTML creative to the Adfox interface.

    For example:

    this.expanded.button1: A link to the product page.

    this.expanded.button2: A link to contacts.

    After adding the banner in the Adfox interface, specify the links on the Events tab.

    The first instance in the line of code will correspond to the Event 1 parameter of the banner. You can use any name for the event.

Google Web Designer
  1. Download a banner template for Google Web Designer.

    You can use this banner code as a basis for making creatives in the editor. Put the contents of the archive into the folder with the program templates, for example:

    /Users/[USER_NAME]/Documents/Google Web Designer/templates
    

    The template contains an adfox_HTML5.js script and a set of parameters for clicks and event counters to work correctly:

    %request.reference_mrc%, %user1%, %eventN%, where N is the event number from 1 to 30.

  2. Click processing.

    All events are assigned to animation elements on the Events tab.

    The Tap area component is used for calling actions.

    Add it and select the Tap Area → Touch/Click.

    On the Custom code tab, select the call of the click function.

    • If a single button is used:

      callClick();

    • If multiple buttons are used:

      callClick(n);

      where n is the number of the event to be called.

    • If you need to call an event from an animation without a click, use the following code:

      callEvent(n);

      where n is the number of the event to be called.

    How to use a stretching 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 Properties panel.

    Use the Align by container and Fluid layout options on the top toolbar.

    If you enable Fluid layout 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 simultaneously use both the relative sizes of elements in percentages and absolute sizes in pixels.

    Sample ready-made project in Google Web Designer, source file.

  3. Publish the project.

    The project has to be published with the following settings:

    • Collect files enabled;
    • Create ZIP archive enabled;
    • Groups unpacking enabled;
    • CSS prefix enabled for WebKit and Mozilla.

Note

When adding a banner to Adfox, the manager needs to know the button and event number correspondence. For each event, the manager adds its own click link, which is then passed to the banner code using a variable.

After publishing the project, archive it with the .zip extension. Your creative is ready to be uploaded to the Adfox banner.

Add a banner to Adfox

To add a banner to Adfox, select the banner type you need and the Screenglide HTML5 [context] template.

Fill in the banner parameters:

  1. Archive with HTML5 creative: Upload a ZIP archive with the project and leave the HTML5 creative code field empty (it will be filled with the contents of the HTML file of your project after you add the banner).

  2. Creative HTML5 code: The content of the HTML code from the archived project (loaded from the archive automatically).

  3. Click URL: Enter the link to the advertiser's site. For the click to work correctly, make sure that the link includes the protocol (http:// or https://).

  4. If the creative in the banner is implemented using images and no click link is specified, the banner will be non-clickable.

  5. If the HTML creative contains multiple buttons leading to different pages of the advertiser's site, specify them on the Events tab of the banner. The developers of the HTML creative should provide information about which buttons correspond to which links.

  6. Link TARGET: In which window the link should be opened:

    • _top: Current window.
    • _blank: New window or tab, depending on the browser settings.
  7. Tracking pixel link: Specify a link to the tracking pixel for counting impressions in a third-party ad management system.

  8. image No. 1 before the expand: If the banner consists of two images, upload the smaller image (before expanding). The banner can also consist of a single image 1. In this case, there will be no expanding.

  9. Image No. 2 after the expand: Optional. If the banner consists of two images, upload a larger image (after expanding).

  10. Expand time (seconds): The time in seconds after which the banner will be automatically collapsed after an automatic or user-triggered expanding.

  11. Shift the content when expanding: Whether or not the banner should shift the content:

    • no: Expanding happens on top of the content.
    • yes: Expanding shifts the content both horizontally and vertically. For a horizontal shift, the container must be a streamlined element (for example, display: inline-block or float: left).
  12. Name for the class attribute of the banner container: If necessary, enter a name (or multiple names separated by a space) for the class attribute of the banner container.

  13. Width before the expand (in px or 100%): The width of the creative before expanding.

  14. Height before the expand (in px or 100%): The height of the creative before expanding.

  15. Width after the expand (in px or 100%): The width of the creative in the expanded form.

  16. Height after the expand (in px or 100%): The height of the creative in the expanded form.

  17. Expand direction: The direction in which the banner should expand:

    • bottom: Down.
    • top: Up.
  18. Styles for banner block: Custom styles for the banner container in a single string. Except for the display style. For example, border: 1px solid red;. Invalid values are ignored by the browser.

  19. Under Advertising label settings:

    • In the Ad label list, select Ad or Social ad, and the label will be added to the banner. If the creative's design already includes the label, you can keep “Disabled” in the drop-down list.

      Note

      Adding the “Social ad” label doesn't automatically define the creative content as social ad. To label creative content as a social advertisement in the state register, select Social ads contract for the corresponding contract with the end advertiser.

    • In the Domain field, specify the advertiser domain, and it will be added to the label: “Ad | example.com” or “Social ad | example.com” (only if you select Ad or Social ad in the drop-down list).

  20. To add a token to a non-clickable banner, enable the Show banner menu option in the banner settings. When the banner is served, the menu icon  will be displayed in the upper right corner of it. When a user clicks this icon, the advertiser information and the copy token button appear (if ad register is enabled for the banner and a third-party token is specified).

    The banner menu contains a link to the rules for using recommendation technologies. That is necessary to comply with paragraph 3, section 1, article 10.2-2 of Federal Law No. 149-FZ On information, information technologies, and information protection", dated July 27, 2006.

    Note

    If a banner is non-clickable (the Transition URL field is not filled in) and it is to be added to the ad register, be sure to show the banner menu. This is the only way to make the token available when serving the banner.

  21. Settings for Russian ad register: The section is only available if the Submit data to state register procedure is selected 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.

    Note

    If a specific banner doesn't need to be added to the ad register, select Do not submit data to state register.

Contact support

Send an email