Our platform supports multiple ad output formats to suit different rendering environments, styling needs, and integration preferences.
Each SDK function that returns an ad accepts a `type` argument, which determines the format of the result.
| Type | Description |
|---|---|
| Json | Structured object with all ad data |
| HtmlTextAd | Ready-to-insert HTML snippet (text ad) |
| HtmlImageAd | HTML snippet with image/icon and text |
| JavaScript | JS code that invokes your custom function |
| AdTypeBannerMediumRectJson | Medium Rectangle Banner (JSON) |
| AdTypeBannerMediumRectHtml | Medium Rectangle Banner (HTML) |
| AdTypeBannerLeaderboardJson | Leaderboard Banner (JSON) |
| AdTypeBannerLeaderboardHtml | Leaderboard Banner (HTML) |
| AdTypeBannerWideSkyJson | Wide Skyscraper Banner (JSON) |
| AdTypeBannerWideSkyHtml | Wide Skyscraper Banner (HTML) |
Use this format if you want full control over rendering.
{
"id": 4,
"url": "https://homestyle.com",
"title": "HomeStyle - Home & Garden",
"description": "Transform your space with our home and garden essentials."
}
An HTML snippet designed for inline text-based ad placement.
<style> .ad-box.ad-text { border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px 16px; background: #fafbfc; max-width: 400px; font-family: Arial, sans-serif; margin: 12px 0; } .ad-label { font-size: 12px; color: #5f6368; margin-bottom: 4px; display: block; font-weight: bold; letter-spacing: 0.5px; } .ad-label a { color: #5f6368; text-decoration: none; } .ad-label a:hover { text-decoration: underline; } .ad-body { font-size: 15px; color: #202124; margin-top: 6px; } </style> <div class="ad-box ad-text"> <span class="ad-label"><a href="https://homestyle.com" target="_blank" rel="noopener noreferrer">HomeStyle - Home & Garden</a></span> <div class="ad-body">Transform your space with our home and garden essentials.</div> </div>
An ad with both image and text, ideal for sidebars or banners.
<style> .ad-box.ad-image { border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px 16px; background: #fafbfc; max-width: 400px; font-family: Arial, sans-serif; margin: 12px 0; overflow: hidden; display: flex; align-items: stretch; } .ad-box.ad-image a { display: flex; text-decoration: none; color: inherit; width: 100%; } .ad-icon { float: left; height: 100%; max-height: 80px; width: 80px; object-fit: cover; border-radius: 4px; margin-right: 14px; background: #fff; flex-shrink: 0; align-self: stretch; } .ad-body { display: flex; flex-direction: column; justify-content: center; flex: 1; } .ad-label { font-size: 14px; color: #5f6368; font-weight: bold; margin-bottom: 4px; letter-spacing: 0.5px; } .ad-body span:last-child { font-size: 15px; color: #202124; } </style> <div class="ad-box ad-image"> <a href="https://petfoodplus.com" target="_blank" rel="noopener noreferrer"> <img class="ad-icon" src="http://147.93.43.199/images/ads/pets.jpg" alt="PetFoodPlus - Pet Supplies"/> <div class="ad-body"> <span class="ad-label">PetFoodPlus - Pet Supplies</span> <span>Shop food and supplies for your pets.</span> </div> </a> </div>
Returns a short JS snippet that calls your provided function with ad content.
handleAd({ "id": 4, "url": "https://homestyle.com", "title": "HomeStyle - Home \u0026 Garden", "description": "Transform your space with our home and garden essentials." });
The SDK wraps this in a `<script>` and injects it or returns it as a string (depending on usage).
The following banner ad types are available for integration in both JSON and HTML formats:
| Type | Description |
|---|---|
| AdTypeBannerMediumRectJson | Medium Rectangle Banner (JSON) |
| AdTypeBannerMediumRectHtml | Medium Rectangle Banner (HTML) |
| AdTypeBannerLeaderboardJson | Leaderboard Banner (JSON) |
| AdTypeBannerLeaderboardHtml | Leaderboard Banner (HTML) |
| AdTypeBannerWideSkyJson | Wide Skyscraper Banner (JSON) |
| AdTypeBannerWideSkyHtml | Wide Skyscraper Banner (HTML) |
- JSON banner types return all ad fields for custom rendering. - HTML banner types return a ready-to-insert `<a><img></a>` snippet for the banner.
These formats are ideal for display in standard IAB banner slots:
These HTML formats use the following CSS classes:
| Class | Description |
|---|---|
| .ad-box | Main ad wrapper container |
| .ad-text | Applied to text-only ads |
| .ad-image | Applied to image+text ads |
| .ad-label | Sponsorship or “Ad” tag or title |
| .ad-body | Text content of the ad |
| .ad-icon | Image used in image ads |
You may redefine these in your own CSS to fully customize ad appearance.