HTML and CSS Reference
In-Depth Information
HTML for creative:
<a href= MACRO target="_blank"></a>
As you can see, it's much more scalable to develop in this fashion rather than update numerous creatives when
changes need to be made down the road.
Working with XML and JSON
By now you have a fair understanding on how ads can be dynamically targeted to you as a user from an ad server point
of view, but let's shift gears a bit and talk more about the technical aspects of dynamic ads as they relate to HTML5
and the open Web. This would be particularly on the creative end of things where you can manipulate the creative
elements of your ad using data. But before you head down this path, you need to be clear on a few ways about how
your creatives can work with external data from various services. Two of the most common communication layers
when working in HTML5 are Extensible Markup Language (XML) and JavaScript Object Notation (JSON). XML and
JSON are widely adopted among the industry in that they're used in many RESTful APIs for various data endpoints.
Note
For good information on restful apis, visit http://blog.apigee.com/detail/restful_api_design .
Using a common and universal language that all lower-level code languages can understand and parse allows
for easy adoption, communication, and ubiquity among web developers. Anything from bringing in a brand's Twitter
feed to pulling in a stock ticker, or even using a weather feed or local retail products, can be pulled into the ad creative.
It's all traditionally done using XML or JSON data, and the following sections are geared toward showing the best way
to work with external data providers with XML and JSON.
XML
XML is probably the most common language for web services. I'm not going to get into the nitty-gritty of XML, but
in the ad world, an advertisement will make a request to some web service by way of an HTTP request, usually with
some necessary URL query parameters. The response that the web service provides to that request will traditionally
be in XML format. Listing 11-1 showcases a request and XML response from Yahoo's open weather service.
Listing 11-1. Yahoo's Weather API XML Example
HTTP Request:
http://query.yahooapis.com/v1/public/yql/jonathan/weather?zip=19428
Server Response:
<query yahoo:count="1" yahoo:created="2012-08-01T23:15:47Z" yahoo:lang="en US" xmlns:yahoo=
" http://www.yahooapis.com/v1/base.rng " >
<results>
<channel>
<title>Yahoo! Weather - Conshohocken, PA</title>
<link> http://us.rd.yahoo.com/dailynews/rss/weather/Conshohocken__PA/*http://weather.yahoo.com/
forecast/USPA0326_f.html </link>
<description>Yahoo! Weather for Conshohocken, PA</description>
<language>en-us</language>
<lastBuildDate>Wed, 01 Aug 2012 6:34 pm EDT</lastBuildDate>
<ttl>60</ttl>
 
 
Search WWH ::




Custom Search