How to make custom native sponsored ads

Sponsored ads are similar to in-feed ads, but they're usually placed on a retail page. They still blend in with the content somewhat but they look more like recommendations instead of an actual product or service listing. You can use native templates to create sponsored ad items that are tailored to your needs.

Sample sponsored ads

This feature requires the Enhanced Ads add-on. For more information on adding add-ons to your subscription, read How to change your subscription.

In this guide, we're going to create a simple sponsored ad using a custom native ad template. This type of native template has all the code - HTML, JavaScript, and style element - necessary to display the ad properly.

If you'd rather sanitize the template and have only HTML inside it, you should make your sponsored ad using a styled native ad template instead. For more information on the differences between custom native ads and styled native ads, read About native ad templates.

Templates for custom native ad items are not compatible with styled native ad items, and vice-versa.

You will learn:

  1. How to create a template for a custom sponsored ad. You can customize the sample code to fit your needs.
  2. How to create a custom sponsored ad item once you have a custom sponsored template.

How to create a custom sponsored ad template

This template will require the user to provide the URL to where the image creative is hosted when creating the sponsored ad item, as well as the URL to the page where the viewer will be taken when they click on the ad. There are also text fields for the header and the body text that need to be filled.

  1. Click Native Ad Templates in the left navigation menu to go to the Templates section.
  2. Click Add Native Ad Template in the Native Ad Templates table. The New Native Template window will appear.
  3. Click Custom Rendering/API. The New Native Ad Template page will appear.

Selecting a native template type

  1. Name the template, then add a URL variable for the destination URL, an image URL variable for the creative, and two text variables (one for the header and one for the body text). In our sample code, we called these variables Sponsored Link, ImageURL, Header, and Description, respectively.
For templates that have multiple variables such as this one, you can drag the icon on the far left of each variable field up or down to reorder your variables.

Creating a custom native sponsored ad template in AdButler

You can save variables and use them in other templates. After adding a variable, click on the three dots at the far right of the variable fields then click Save Variable as Template. To use a saved variable, click Add Saved Variable while creating a native template.
  1. Enter the code in the HTML Template (Custom Rendering) field, then click Save Changes.

Here's the code we used in our example:

<!DOCTYPE html>
<html lang="en">
    <head>
        <style>
            .sponsored-container {
                position: relative;
                width: 425px;
                height: 152px;
            }

            .sponsored-content-container {
                --sponsored-content-height: 120px;
                display: grid;
                grid-template-columns: repeat(2, auto) 1fr;
                grid-template-rows: var(--sponsored-content-height);
                grid-gap: 24px;
                font-family: Arial;
                text-decoration: none;
                padding: 16px;
            }

            .sponsored-image {
                height: var(--sponsored-content-height);
                width: var(--sponsored-content-height);
                border-radius: 10px;
            }

            .sponsored-text-container {
                color: #000000;
                display: grid;
                grid-template-rows: 1fr repeat(3, auto) 1fr;
                row-gap: 4px;
                font-size: 14px;
            }

            .sponsored-header {
                grid-row: 2/3;
                font-size: 16px;
                font-weight: bold;
                margin-bottom: 4px;
            }

            .sponsored-description {
                grid-row: 3/4;
            }

            .sponsored-link {
                grid-row: 4/5;
            }

            p {
                margin: 0;
            }

            .sponsored-close-button-container {
                position: absolute;
                top: 16px; /* match container top padding */
                right: 5px;
                cursor: pointer;
            }

            .sponsored-close-button {
                width: 21px;
                text-align: center;
                display: inline-block;
                color: #ffffff;
                font-size: 18px;
                background: #000000;
                border-radius: 21px;
                user-select: none;
            }
        </style>
    </head>
    <body>
        <div class="sponsored-container">
            <a href="[TRACKING_LINK]" target="_blank" class="sponsored-content-container">
                <img src="[%ImageURL%]" class="sponsored-image">
                <div class="sponsored-text-container">
                    <p class="sponsored-header">[%Header%]</p>
                    <p class="sponsored-description">[%Description%]</p>
                    <p class="sponsored-link">[%Sponsored Link%]</p>
                </div>
            </a>
            <div class="sponsored-close-button-container">
                <span class="sponsored-close-button" onclick="closeButton()">×</span>
            </div>
        </div>
        <script>
            function closeButton() {
                document.querySelector('.sponsored-container').style.display = 'none';
            }
        </script>
    </body>
</html>

You can now use this template to create a custom sponsored ad ad item.

Back to top

How to create a custom sponsored ad ad item

  1. Go to the section of the relevant zone (Your AdButler > Publishers > Your Publisher > Your Zone) or campaign (Your AdButler > Advertisers > Your Advertiser > Your Campaign).
Custom native ad items can be assigned only to Standard zones or to Native zones. For Standard zones, the zone size must be set to Dynamic. For Native zones, the Enable Custom Rendering option must be turned on. Both the zone size and the custom rendering option can be configured only when creating a zone and cannot be changed afterward.
  1. Click Add Ad Item in the Ad Items table. The Add Ad Item window will appear.
  2. Click Native (Custom Rendering/API). The New Ad Item page will appear.

Creating a native (custom rendering/API) ad item

  1. Set the ad item's size.
  • If the ad item or its campaign will be assigned to a Standard zone, you must set the ad item's size to Dynamic.

  • If the ad item or its campaign will be assigned to a Native zone, you must enter the ad item's exact size. You can do this either by selecting Preset Size and then selecting the matching width and height values from the dropdown menu, or selecting Custom Size then entering the values in the fields that appear.

  1. Select your sponsored ad custom native template in the Template dropdown menu.
  2. Fill in the rest of the fields as needed, including the URL, image URL, and text fields. If you entered a destination URL, you can test it by clicking Open Destination URL to the right of the field.
  3. Click Save Ad Item.

Creating a custom native sponsored ad item in AdButler

Back to top


Can't find what you're looking for?

Send us an email

hello@adbutler.com

Visit the blog

For more ad serving tips, industry news and AdButler insights.