Getting Started Smaato Ad Tag


The Ad Tag can be easily enriched with user targeting data, device ID, demographics or location data (see table below for more details). Furthermore, the Ad Tag gives you the option to choose ad dimension, an auto-reload timer, and ad display mode (inline or fullscreen). Lastly, Ad Tag can also be enriched using your ad server’s replacement macros to pass additional targeting data.

Ad Tag Code for In-App

Inline Ads

<div id="smaatoad" style="padding:0px"></div>
<script type="text/javascript" src=""></script>
   function myJSCallBack(status) {
       if (status == "SUCCESS") {
           // TODO Handle ad available (Option)
       } else if (status == "ERROR") {
           // TODO Handle not ad available
       adDivId: "smaatoad",
       publisherId: REPLACE_WITH_PUBLISHER_ID,
       autoReload: 240,
       dimension: "xxlarge",
       dimensionstrict: true,
       keywords: "cars,shopping",
       gender: "m",
       age: 27
   }, myJSCallBack);

Ad Tag Usage

Insert the code at the desired section of your application.

Replace REPLACE_WITH_ADSPACE_ID with your Ad Space ID and replace REPLACE_WITH_PUBLISHER_ID with your Publisher ID.

Ad Tag Advanced Usage

You can add additional targeting data by inserting additional parameter lines. Usually, you will insert your ad server’s replacement macros here instead of actual data. The format to be used is shown here:

PARAMETER: 'STRING' (for string values) with quotation marks

PARAMETER: true (for boolean values) WITHOUT quotations marks

PARAMETER: 12345 (for numeric values) WITHOUT quotation marks


city: 'Miami'
formatstrict: false
age: 25

You can also prevent your AdTag from auto-reloading by either setting the autoReload parameter to 0, or by adding the following code snippet just below your AdTag:

<button onclick = stopAutoReloadAd()>Stop Auto Reload Ad</button> <script>
function stopAutoReloadAd() {

Ad Tag Parameters

Parameter Mandatory Description Possible Value Example
adDivId Yes

The Div ID where the ad should be placed

See example ‘smaatoad’
dimension No

The desired dimension of ads to be returned. 
Standard Formats MMA (default): 
Any MMA size (the system will determine the right one for the requesting phone)

  • Medium Rectangle (300×250) 
  • Leaderboard(728×90)
  • Skyscraper(160×600)
  • Full screen(320×480)
  • Full screen(480×320)
  • Full screen(768×1024)
  • Full screen(1024×768)
  • “mma” 
  • “medrect” 
  • “leader” 
  • “sky”
  • “widesky”
  • “small”
  • “large”
  • “medium”
  • “xlarge”
  • “xxlarge”
  • “full_320x480” 
  • “full_480x320” 
  • “full_640x960” 
  • “full_960x640”
  • “full_1136x640”
  • “full_768x1024” 
  • “full_1024x768”
  • “full_800x1280”
gender No The user’s gender, if available male,female,m,f “m”
gdpr No


Parameter used to enable/disable gdpr

1, 0 1
gdpr_consent No

Base64-encoded consent string

only when gdpr value is set to 1

See example “BOMCfKjOMdcevABAB8AAAAAZ+A==”
lgpd No


Parameter used to enable/disable lgpd

1, 0 1
lgpd_consent No

Base64-encoded consent string

only when lgpd value is set to 1

1, 0 1
age No

The user’s age.2-digit number. If only a range is available, use the mean average

See example 25
keywords No

Tags (free text, case insensitive) describing the content

string: comma separated values ‘motorsport,news,cars’
qs No

Query String: A search term entered by the user within the mobile site

string: comma separated values and + separate two part names e.g. San Franciso ‘coffee,san+francisco’
sync No

Parameter used for requesting the ad synchronously. (Default: false)

true, false true
did Yes

Unified Device ID should be enriched with the device id (iOS and/or Android). The Ad Tag will automatically pick up the right parameter for you and let us know if it is iosadid or androidid.

iOS – Identifier for Advertising (IDFA) please refer to ASIdentifierManager

Android – Google Android Advertising ID please refer to

Android – Android ID please refer to Settings.Secure.ANDROID_ID

See example ‘1D76F5D1-1983-47C8-B18D119D52E4597A’
diddnt Yes

Apple’s advertisingTrackingEnabled Property.

(false = user has decided against tracking – this is the opposite way around as on Android)

Android limit ad tracking preference.

(true = user has decided against tracking – this is the opposite from iOS)

true, false false
coppa Yes

“0” will indicate if your content should not be treated as child-directed for purposes of COPPA

“1” will indicate that your content should be treated as child-directed for purposes of COPPA

0, 1 0
cb No

Cachebuster. Insert your cachebuster macro here. This is optional: If no cachebuster is set, we’ll generate our own

string ‘%%CACHEBUSTER%%’ (Dart)
autoReload No

Automatically refresh ad. Value in seconds Minimum value: 10

Any number, minimum: 10, maximum 240. 45


(but highly recommended)

GPS coordinates of the user’s location (latitude)

Latitude as decimal degrees. 37.530676


(but highly recommended)

GPS coordinates of the user’s location (longitude)

Longitude as decimal degrees. -122.262447


The country of the users location

See example ‘United%20States’


The country code of the users location

See example ‘US’


The city name of the users location

See example



The postal code of the users location

See example ‘94402’


The region of the users location

See example ‘Texas’


Will enable user geolocation tracking

true, false (default) true


(‘No’ if the device is requesting directly or if you are sending the correct referer header of the requesting webpage)

Refers back to the origin of the user

(i.e. the URL of your mobile website)

string “”


(but highly recommended)

The Application or Mobile Website IAB category



(but highly recommended)

The Adspace’s name. Please use the following format: AppOrSiteName_OSName_AdspaceDimension



Ads for Testing Purposes

Adspace ID Type Description
130626424 Rich Media Banner / Med-rect / Leaderboard / Skyscraper
130635694 Static Image Banner / Med-rect / Leaderboard / Skyscraper
130635706 MRAID Banner / Med-rect / Leaderboard / Skyscraper
133150211 Rich Media / Video Interstitial (Video with an end-card + Rich Media Interstitial for 320×480, 480×320, 1024×768 & 768×1024)
133150079 Outstream Outstream Video

Last Modified: November 23, 2021 at 8:05 pm

© 2005-2020 Smaato, Inc. All Rights Reserved. Smaato® is a registered trademark of Smaato, Inc.

Privacy Policy | Cookie Policy | Support