Swelen Labs

Swelen WebApp SDK

Last Build: 1.0 - 2011/12/22

Download

Swelen WebApp SDK - Build 1.0 (status: beta)

The Swelen Mobile Manager SDK for WebApp is provided as a JavaScript Tag to be inserted into your website.

This library is currently working with:
- classic desktop websites
- websites specially designed for mobile devices (aka Mobile Websites)
- applications specially designed to run in native browsers (aka WebApps or Web Applications)

Supported products:
- Swelen product suite (Swelen Magnet and Swelen Mobile Manager)
- NetAffiliation MarketPlace product suite.

 

Integration Overview

Swelen Ad Script Tag is some JavaScript code used to ensure the consistency of Swelen Magnet or Swelen Mobile Manager. The presence of this tag is essential for the proper displaying of ads on your website. Swelen Ad Script Tag is very fast and does not slow down performance or load time of your site.

<html>
   <head>
   <title>Title of your page</title>

<!-- Swelen Ads -->
<script type="text/javascript" src="http://shea.swelen.com/showAds.js"></script> <script type="text/javascript">
_$welen.showAds.init({test:false});
_$welen.showAds.getFixedSlot({
     slotUID : 'fixed-320x50-test',
     targetID : 'banner'
});
</script>
<!-- Swelen Ads -->

   </head>
   <body>
         ...

         <div id="banner" class="swelenFixedBanner"></div>

         ...
         ... .. ....
   </body>
</html>

Copy the Swelen Ad Script Tag where you want ads on your website ...

Place the script just before the ending </head> tag.

Place a div in your website content where you want ads to appear.

What does Swelen do with my information?

Swelen gives great importance to the protection and confidentiality of your information. The data and information gathered on your website are anonymously exclusively used for statistical purposes. No personal details is recorded on users.

Who can see my information?

The data and information gathered from your website are encrypted and used only by Swelen's bots to display ads on your website. Your statistical reports are in no case provided to any third party or Swelen's staff.

 

Ad Invocation for Overlay ads

Overlay Ads are displayed on top of your website.
You do not have to specify a placement to invoke Overlay Ads.

Overlay Ads must be invoked with the showAds.get() method, like this:

<script type="text/javascript">
	_$welen.showAds.init({test:false});
	_$welen.showAds.get('___YOUR_SLOT_UID___');
</script>	

Note:
- To test an Overlay Ad, use the following SLOT_UID: orientablesplashscreen-320x460-test
- You can not invoke more than one Overlay Ad per page (the method showAds.get() can only be invoked one time per page).

 

Ad Invocation for fixed banners

Example: Displaying a fixed 320x50 ad in your website

To display fixed banner ads, you need to define slot placements on your site where you want ads to appear.
To define a slot placement, you can use a DIV tag with an unique ID, like this:

<div id="myCoolBanner" class="swelenFixedBanner"></div>

The instanciation of a Fixed Ad need to be done with the showAds.getFixedSlot() method, like this:

<script type="text/javascript">
	_$welen.showAds.init({test:false});
	_$welen.showAds.getFixedSlot({
		slotUID : '___YOUR_SLOT_UID___',
		targetID : 'myCoolBanner'
	});
</script>

Notes:
- To test a Fixed Banner Ad, use this SLOT_UID: fixed-320x50-test
- Your banner will automatically scale to fit the available screen's width
- When Swelen does not have ad to display, your banner will stay hidden.
- You can avoid this behavior by removing the class swelenFixedBanner in the DIV

As soon as your integration is working fine, you will be able to see test ads on your site.
You must not put your site in production with test UIDs. Ask your agency to get SLOT_UIDs that are ready for production.

 

Complete Example

The following example demonstrates how to instanciate 1 Overlay Ad (SplashScreen) + 3 Fixed Banner Ads (320x50 ads).
This code will only display ads when your website is visited on mobile devices.
Click here to see how to display ads on desktop computer websites as well.

<html>
<head> <title>Your WebSite</title> <script type="text/javascript" src="http://shea.swelen.com/showAds.js"></script>
<script type="text/javascript">
_$welen.showAds.init({test:false});
_$welen.showAds.get('orientablesplashscreen-320x460-test'); _$welen.showAds.getFixedSlot({ slotUID : 'fixed-320x50-test', targetID : 'banner1' }); _$welen.showAds.getFixedSlot({ slotUID : 'fixed-320x50-test', targetID : 'banner2' }); _$welen.showAds.getFixedSlot({ slotUID : 'fixed-320x50-test', targetID : 'banner3' });
</script>
</head>
<body> <p>In your website, put the DIVs where you want ads.</p>
<div id="banner1" class="swelenFixedBanner"></div> <div id="banner2" class="swelenFixedBanner"></div> <div id="banner3" class="swelenFixedBanner"></div> </body> </html>

 

Advanced Features

The showAds.init() method can accept 2 optional parameters (desktop and mobile) so
you can choose to display ads only on desktop computers or mobile devices.

Ex1: Displaying Swelen Ads only on mobile devices (default behavior):

_$welen.showAds.init({test : false});

 

Ex2: Displaying Swelen Ads only when your site is visited from a desktop computer:

_$welen.showAds.init({
	test : false,
	desktop : true,
	mobile : false
});

 

Ex3: Displaying Swelen Ads on both mobile and desktop devices:

_$welen.showAds.init({
	test : false,
	desktop : true,
	mobile : true
});