HTML and CSS Reference
In-Depth Information
requests from with the ad content. If that domain doesn't match the access-control header, the response to the ad
will fail.
Another interesting concern involves users' personal and private data. This is an important topic in any form of
advertising, especially when sharing data between domains, so be sure to check with the publisher and data provider
to ensure their terms of services (TOS) comply with the features you intend to use in your advertisements. There are
plenty of web services out there that you can “technically” use, but the last thing you want to worry about is a lawsuit!
Also, be sure, when you are working with the publisher for these kinds of rich integrations, to obtain a test page,
but ensure that the test page is hosted on the same domain as the live page and represents the experience as closely
as possible on the day of launch. If you're going to be posting and requesting data between the ad server and the
publisher's and data provider's domains, they'll all need CORS access privileges to do so. I've seen many campaigns
get “whitelisted” to a sandbox or test account just to have the thing go belly up once it went live because the content
was hosted on a different domain.
Finally, keep in mind that CORS is in a working draft spec, but it's quickly showing adoption in all of the
major browsers, as outlined by Caniuse ( http://caniuse.com/#feat=cors ) . There's more information on the CORS
spec at www.w3.org/TR/cors . While you're at it, take a deep dive into enabling CORS on your server by visiting
http://enable-cors.org .
Microdata
Just in case you wanted to extend HTML5 a bit more, the microdata API adds a supplementary layer of semantics to
your HTML markup. With this added information, search engines, browsers, and machine readers can mine through
all the metadata in your markup and ultimately provide a richer and more adaptable experience for different devices,
including those that can assist special-needs individuals, if this information is made available by the developer.
Microdata uses simple name/value pairs in markup attributes to define items. It can be really helpful in dynamic
advertising or asset tagging to learn semantically when a value was last updated—or even to simply keep track of
changes to a creative. In the following example, using the itemprop=date , you can timestamp directly into the ad's
markup and have specific information to parse or filter at a later time. Let's take a look at some sample markup (see
Listing 6-8) that may be included in a dynamic retail ad selling drink products.
Listing 6-8. Microdata Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
<body>
<span itemprop=products>
<span itemprop=name><a itemprop=url href=" http://www.retailer.com/soda ">Soda</a></span>
<time itemprop=date datetime="2012-06-04">Last Updated</time><span itemprop=name><a itemprop=url
href=" http://www.retailer.com/juice " >Juice</a></span>
<time itemprop=date datetime="2012-06-14">Last Updated</time><span itemprop=name><a itemprop=url
href=" http://www.retailer.com/milk ">Milk</a></span>
<time itemprop=date datetime="2012-06-05">Last Updated</time><span itemprop=name><a itemprop=url
href=" http://www.retailer.com/beer ">Beer</a></span>
<time itemprop=date datetime="2012-06-10">Last Updated</time>
</span>
</body>
</html>
Now you can parse through all the itemprop=products nodes in the markup while referencing the itemprop=date
and datetime attributes. Anywhere you see a dated product different from the current date, you know that the product
 
Search WWH ::




Custom Search