Mocean Mobile Macros Documentation

From Mocean Mobile Wiki

(Redirected from Macro Documentation)
Jump to: navigation, search

Contents

Overview

Mocean Mobile platform allows for macros (placeholders) to replace a certain text wherever it appears in your ad code or requests. After being processed by the ad server, all the macros used will be replaced with the corresponding values (see tables below).

All Mocean Mobile macros can be divided into three groups: Click URL Placeholders, Rich Media Placeholders and Placeholders Common To Rich Media and Click URL.

Click URL Placeholders

While editing 'Creative Settings' (or creating a new ad), you specify the CLICK THRU URL.

Click Thru URL

This box supports only placeholders listed in the table below.

Placeholder Description
%DID% Replace with domain (site) ID where the ad impression occurred
%CPID% Replace with a unique ID of the ad
%SID% Show ID is passed through the landing page
%UID% Unique user ID
%RANDOM% Replace with a random number
%TIMESTAMP% Replace with the Unix timestamp
%REFURL% Encoded URL of web page where the ad impression occured
%PHONE_BRAND% Replace with the corresponding phone brand name from WURFL
%PHONE_MODEL% Replace with the corresponding phone model name from WURFL

Using Click URL Placeholders

Now, macros from the table above are supported in your direct links (i.e. click URLs). If specified in ad requests, they will be populated with the appropriate values and users will be successfully redirected to a campaign landing page.

Just specify the required macros in your campaign click URL as it is shown below:

http://test.domain.com/?sid=%SID%&cid=%CPID%&did=%DID%

After backend processing, your click URL will look like this:

http://test.domain.com/?sid=a73cc290-20fc-11e1-ac3b-0019b9f99000&cid=13243&did=4596

By adding to campaigns Click URL, parameters %CPID%, %SID% and %DID% can be used for tracking multiple conversion (see User Defined Conversion Code)


Rich Media Placeholders

When you create a rich media ad, you can also use macros designed for rich media ads in the special text box.

Rich Media HTML Box

This box additionally supports the following placeholders.

Placeholders Description
%LINK% Replace with a link (wrap URL) for tracking the click back to the destination URL
%ELINK% Replace with an encoded link for tracking the click back to the destination URL
%WIDTH% Replace with MMA max image width based on UA passed in the ad call.
%HEIGHT% Replace with MMA max image height based on UA passed in the ad call.
%DEVICEWIDTH% Replace with the device screen width.
%DEVICEHEIGHT% Replace with the device screen height.

Using Rich Media Placeholders

One of the ways of using rich media macros is to specify them in your ad code. Here is an example of a rich media ad code with replaceable parameters specified:

Using Rich Media Placeholder

<iframe src="http://geo.ipromote.com/ad/?typ=1&pub=1&nid=1366&site=6885&adfmt=11&zip&сlick=%ELINK%" width="300" height="50" marginwidth="0" marginheight="0" frameborder="0" scrolling="no">
</iframe>

As a result, the code of the ad after replacing macros by the corresponding values will be as follows:

<iframe src="http://geo.ipromote.com/ad/?typ=1&pub=1&nid=1366&site=6885&adfmt=11&zip&click=http%3A%2F%2Fads2.mocean.mobi%2Fredir%2F2620ee70-aba9-11e0-97e1-001ec9fd3a50%2F0%2F59007" width="300" height="50" marginwidth="0" marginheight="0" frameborder="0" scrolling="no">
</iframe>

Using Size MACROS

If you need to use size placeholders in your rich media, add them to your rich media tag:

Using Size Macros

<a href="hello.html">%DEVICEWIDTH% %DEVICEHEIGHT%, %WIDTH% %HEIGHT%</a>

As a result, you will get the following ad text:

<a href="hello.html">800 600, 320 50</a>

Custom Redirection

If you like to have more than one click URL with different destinations in your ad, additionally to the %LINK% macro use the redir GET parameter (%LINK%?redir=...). In this case, the backend will just count the click (regardless of what the click url textbox) and redirect you to whatever is in redir.

NOTE: URL specified in redir must be encoded.

Example,

<a href="%LINK%?redir=http%3A%2F%2Fdomain1.com%2Flink1">Click Link 1</a>
<a href="%LINK%?redir=http%3A%2F%2Fdomain2.com%2Flink2">Click Link 2</a>

Custom Redirection


Placeholders Common To Rich Media And Click URL

Placeholder Description
%IP% Replaced with ip detected by a carrier gateway which the user device is connecting over (either passed directly in the ad call).
%USERAGENT% Replaced with user agent of the mobile device (either passed in the ad call as the ‘ua’ parameter).
%COUNTRYCODE% Replaced with a country code extracted from ad call or auto detected by IP.
%REGIONCODE% Replaced with a region code (a state code in case of US) or auto detected by IP.
%LATITUDE% Replaced with the latitude value of the user device (either passed in the call or auto detected by IP).
%LONGITUDE% Replaced with the longitude value of the user device (either passed in the call or auto detected by IP).
%ZIP% Replaced with zip code as entered in the ad call.
%DMA% Replaced with dma (metro) code as entered in the ad call using ‘dma’ parameter.
%VAR_param% Replaced with the custom parameter (‘param’) value passed in the ad request. NOTE: You may use any number of custom parameters and name them as you wish.

Using MACROS in Rich Media Tags

If you want to use the listed placeholders in your rich media, simply specify those desired in your rich media tag:

Using Location MACROS in Rich Media Tags

<a href="%LINK%">Test code macro %COUNTRYCODE%, %REGIONCODE%, %LATITUDE%, %LONGITUDE%, %ZIP%, %DMA%, %VAR_p1%, %VAR_p2%, %IP%, %USERAGENT%</a>

Suppose the ad request is as follows:

http://ads.mocean.mobi/ad?zip=10013&dma=702&p1=123&p2=abc

As a result, your ad text will be as follows:

Test code macro RU, 75, 56.5, 84.966705, 10013, 702, 123, abc, 91.221.60.18, Mozilla%2F5.0+%28Linux%3B+U%3B+U%3B+Android+2.3.4%3B+ru-ru%3B+SonyEricssonMT15i+Build%2F4.0.2.A.0.42%29+AppleWebKit%28KHTML%2C+like+Gecko%29+Version%2f4.0+Mobile+Safari%2F533.1

Using MACROS in Click URL

If you need any placeholders (listed under the 'Placeholders Common To Rich Media And Click URL' heading) to be specified in your click URL, add them to the ad call using the corresponding ad request parameters. To obtain the list of available request parameters, see Mocean Ad Request API.

http://www.example.com/?ip=%IP%&ua=%USERAGENT%&country=%COUNTRYCODE%&region=%REGIONCODE%&lat=%LATITUDE%&long=%LONGITUDE%&zip=%ZIP%&dma=%DMA%&p1=%VAR_p1%


Personal tools