Overview
Getting up and running as an application developer with Millennial Media is very simple. It involves a quick three-step process:
- Upon signing up with Millennial Media, he or she will create an account for you in our reporting system.
- Review the coding samples providing on this Wiki, as well as the simple integration of that ad coding in to your site or application.
- Ensure you test as close to the production as possible, and review the reporting to ensure everything looks good.
Contents |
Required Variables
The key to providing relevant ads into your site or application is to provide Millennial Media with key values that will help us determine Country, Carrier, Handset, and uniquely identify the user when requesting ads. Each of these parameters is critical to serving ads correctly and is discussed in further detail below.
AUID
This value is used to uniquely identify a user when requesting an ad. This is used for frequency capping and other types of reach analytics needed by many advertisers.
If you review our integration code, you will see that this value is obtained by querying HTTP headers for the SUBNO, XID, CLIENTID, or REMOTE ADDRESS of the handset. We utilize case statements within our code to obtain the best possible value for a unique identifier of the user.
Public IP Address
This value is the Public IP address of the device that is requesting the ad unit. This allows Millennial Media to identify the country and carrier of the device. Private IP addresses on WiFi networks will NOT get identified and thus will not get served ad units.
The code below is able to extract the Public IP address of the device by utilizing the REMOTE_ADDR HTTP header. This code requires that the code reside on a server that is directly communicating with the handset. If you have an internal server in between the handset and this server, you will need to utilize the X_FORWARDED_FOR HTTP Header in order to obtain the Public IP address of the device.
UA String
This value is the UA string of the device browser. This value is used to determine the handset that is making the request and allows Millennial Media to determine certain device characteristics in order to provide the correct ad unit for the request. Without the UA string, Millennial Media is unable to determine what type of device is making the request and can exclude the request for a certain campaign that is targeted to a specific device.
In order to determine the UA string of the device browser our code utilizes the HTTP_USER_AGENT HTTP header to insert the proper UA string into the ad request. Again, this code requires that the code reside on a server that is directly communicating with the handset. If you have an internal server in between the handset and this server, you will need to forward the proper UA string into the ad call.
Placement ID
This value is a unique identifier provided by Millennial Media and needs to be provided in every request in order to provide site metrics back to the Publisher. Without the Placement ID, you will not receive any ad units. Metadata: Many publishers are asking their users to register and provide demographic and psychographic information. Millennial Media leverages the value of the anonymous information collected by our publishers about their users. We call this information metadata. The most frequently-used examples of this metadata are age, gender and zip code. Each section below describes the different methods to pass this information, whether you are a site or an application.
Metadata
By adding lines to your code, you can provide age, gender, zip code or other information that you have available to you, and that you are permitted to share with us. This can be done by simply appending &variable=value to your code. In the table below, you’ll see different variables that you are able to pass into the Millennial Media ad infrastructure.
| Variable | Example Values |
| age | 23 |
| gender | male |
| zip | 90210 |
| marital | single |
| income | 100,000 |
| lat | 32.0678 |
| long | 101.089 |
Below is an example of passing age, gender, zip, and lat/long in our infrastructure during a standard ad request.
http://ads.mp.mydas.mobi/getAd.php5?apid=357&auid=63.145.58.2&ua=Mozilla%2f5.0+(Windows%3b+U% 3b+Windows+NT+5.1%3b+en-US%3b+rv%3a1.8.1.8)+Gecko%2f2007 1008+Firefox%2f2.0.0.8&uip=63.145.58.2 &age=23&gender=male&zip=90210&lat=32.0678&long=101.089
Other variables can also be provided. For example, some Publishers have asked their users to provide marital status, annual income, political affiliation, product preferences or other information. In this example, I’ve included marital status and income.
http://ads.mp.mydas.mobi/getAd.php5?apid=357&auid=63.145.58.2&ua=Mozilla%2f5.0+(Windows%3b+U% 3b+Windows+NT+5.1%3b+en-US%3b+rv%3a1.8.1.8)+Gecko%2f20071008+Firefox%2f2.0.0.8&uip= 63.145.58.2&age=23&gender=male&zip=90210&marital=single&income=100000&lat=32.0678&long=101.089
If you’d like to pass along additional information, you may do so by informing your Millennial Media Publisher Services Representative of the information you’d like to provide and the name that you’ve given to the value you’re providing.
Mediation Layers
We work with several Mediation partners to deliver ads within your website or application. Most notably, DART and Atlas; however, we support a plethora of other mediation layers. To inquire about who we work with to provide mobile ads to your inventory, please contact your Publisher Services representative.
Ad Responses
The two responses below are examples of HTML responses. The first is a standard banner ad response, and the later is a HTML response with JavaScript embedded for Rich Media creatives.
Banner Ad Response
<a href="http://bank18.clicks.mp.mydas.mobi/handleClick.php5?apid=357&acid=1027& auid=4234082072eec26db95af554fb953029&osid=18&urid=47ecd206e6e659fc5c0840d1f53d2814 &ri=18&mmid=2957&uip=38.118.54.2&orut=1247243737"> <img src="http://bank18.ads.mp.mydas.mobi/getImage.php5?apid=357&mode=live&acid=1027& auid=4234082072eec26db95af554fb953029&osid=18&urid=47ecd206e6e659fc5c0840d1f53d2814& ri=18&mmid=2957&orut=1247243737" alt="Sup+Dawg%3F" width="168" height="28"/></a>
Rich Media Ad Response
In addition to image and text creatives, we will also be providing Rich Media creative banners in the form of JavaScript and XHTML. As a result, you should not parse the Millennial Media response for an image or text banner, as there will be Rich Media creatives returned to your site. By parsing the Millennial Medial response, there is a much greater chance that the creative will be broken when delivered to the handset.
Additional examples of Rich Media creatives can be viewed at our demo site. If you view the source of these creatives, you will see an example of the response back to your sites.
Site Coding
To view our ad server call in ASP click here
To view our ad server call in JSP5 click here
To view our ad server call in PERL click here
To view our ad server call in PHP click here
To view our ad server call in Ruby on Rails click here
To view our ad server call in VB.net click here