This document outlines the method to integrate the VMAX Web App for Tizen using Tizen Studio.
Before commencing the integration, ensure that you have created the necessary adspots on the VMAX Control panel
Integrating VMAX Web App SDK into Tizen Web App is a Three Step Process:
- Add VMAX script tag in head of web page
- Integrate <ins> tag on a page where you want to show ad
- Enabling ad
Step 1:
To use Vmax Ads in Web applications:
Add below the script tag in the head of your web page.
1 2 |
<script type="text/javascript" src="http://cdn.vmax.com/tia/js/app.js"> |
Step 2:
Integrating Display Ad: Banner and Billboard
Place the <ins> tag on a page where you want to show ad.
1 |
<ins class="adsbyvmax" id="[UNIQUE_PLACEMENT_ID]" data-adspot-key="[ADSPOT-KEY]" data-refresh-after=”[TIME-IN-SECS]” ></ins> |
replace:
UNIQUE_PLACEMENT_ID: Any unique string for ad placement within the page
ADSPOT-KEY: Adspot key that you can get from vmax interface
TIME-IN-SECS: Seconds after which you want to reload the ad.
Integrating Display Ad: Interstitial
Place the <ins> tag somewhere on a page.
1 |
<ins class="adsbyvmax” id="[UNIQUE_PLACEMENT_ID]" data-adspot-key="[ADSPOT-KEY]"> </ins> |
Replace:
UNIQUE_PLACEMENT_ID: Any unique string for ad placement within the page
ADSPOT-KEY: Adspot key that you can get from vmax interface
Integrating Native Ad: Native In-Feed and Native Content stream
Place the <ins> tag on a page where you want to show ad.
1 |
<ins class="adsbyvmax" id="[UNIQUE_PLACEMENT_ID]"adsbyvmax" data-adspot-key="[ADSPOT-KEY]" data-refresh-after=”[TIME-IN-SECS]”></ins> |
Replace:
UNIQUE_PLACEMENT_ID: Any unique string for ad placement within the page
ADSPOT-KEY: Adspot key that you can get from step 3
TIME-IN-SECS: Seconds after which you want to reload the ad.
Customizing Native Ad
VMAX will render native ad in its default format. Developer can customize rendition.
You can access native elements via data-vmax-element.
Eg: <span data-vmax-element=”title”></span>
To register click event container needs to wrap with cta-enabled.
Eg. To make title clickable:
1 2 3 4 5 6 7 8 9 10 11 |
<ins class="adsbyvmax" id="[ENTER_UNIQUE_ID]" data-adspot-key="[ADSPOT_KEY]"> <div data-vmax-element ="cta-enabled"> <div data-vmax-element ="ctaText">Click Here</div> <span data-vmax-element="title"></span> </div> </ins> |
List of native elements:
Element | Values | |
title | Text for Title. Max 30 chars. | Always |
ctaText | Text for Call To Action. | Always |
desc | Description. Max 90 chars. | Optional |
rating | Rating for app. | Optional |
downloads | Download count for app. | Optional |
price | Price in USD. | Optional |
imageIcon | URL for image icon. Dimension: 80×80. | Always |
imageMain | URL for main image. Dimension: 1200×628. | Optional |
imageMedium | URL for image. Dimension: 300×250. | Optional |
imageBanner | URL for image. Dimension: 320×50. | Optional |
imageTile | URL for image. Dimension: 750×750. | Optional |
desc2 | Long description. | Optional |
likes | Likes | Optional |
salePrice | Price in USD after discount. | Optional |
phone | Phone number. | Optional |
address | Address | Optional |
cta-enabled | Enables click event on Ad | Always |
Integrating Video Ad: Interstitial
Place the <ins> tag somewhere on a page.
1 |
<ins class="adsbyvmax” id="[UNIQUE_PLACEMENT_ID]" data-adspot-key="[ADSPOT-KEY]"> </ins> |
Replace:
UNIQUE_PLACEMENT_ID: Any unique string for ad placement within the page
ADSPOT-KEY: Adspot key that you can get from vmax interface
Integrating Video Ad: Rewarded video
Place the <ins> tag somewhere on a page.
1 |
<ins class="adsbyvmax” id="[UNIQUE_PLACEMENT_ID]" data-adspot-key="[ADSPOT-KEY]"> </ins> |
Replace:
UNIQUE_PLACEMENT_ID: Any unique string for ad placement within the page
ADSPOT-KEY: Adspot key that you can get from vmax interface
Integrating Video Ad: Pre Roll video
Place the <ins> tag somewhere on a page.
1 |
<ins class="adsbyvmax” id="[UNIQUE_PLACEMENT_ID]" data-adspot-key="[ADSPOT-KEY]"> </ins> |
Replace:
UNIQUE_PLACEMENT_ID: Any unique string for ad placement within the page
ADSPOT-KEY: Adspot key that you can get from vmax interface
Step 3:
Requesting Ads:
Call the showAd() function whenever you want to show the ad on the page.
1 2 3 4 5 |
<script> VMAX.showAd(“<UNIQUE_PLACEMENT_ID>”); </script> |
Pass the <UNIQUE_PLACEMENT_ID> of the ins tag to the showAd() function.
Call the resumeAd() function whenever you want resume the ad after the App state changes from pause to active.
1 2 3 4 5 |
<script> VMAX.resumeAd(); </script> |
In Case of Pre Roll video, First need to call VMAX.setVideoPlayerDetails which takes two parameters as input. First parameter specifies where to show the ad and second parameter is Boolean value which can be either true or false. If true then addition features such as skip Ad button, zoom-in and zoom-out gets enabled else it’s not shown.
1 2 3 4 5 6 7 |
<script> VMAX.setVideoPlayerDetails(<UNIQUE_PLACEMENT_ID>,<true/false>); VMAX.showAd(“<UNIQUE_PLACEMENT_ID>”); </script> |
You can place multiple <ins> tag on a single page.
Click here for appendix