HTML and CSS Reference
In-Depth Information
in some mobile browsers this is perfectly fine. However, on iOS and mobile Safari, where third-party cookies are
disabled by default, these devices and browsers are prohibited from tracking site events using the cookie approach.
To better illustrate this setting, look at Figure 8-9 , which exhibits the default settings on iOS.
Figure 8-9. Default cookie settings on iOS Safari
This state of affairs can be a big limitation if you're relying on the cookie model in mobile ads. Instead, leverage
HTML5's localStorage property to place that information, rather than a cookie, on the client's browser. Listing 8-9
shows how this can be achieved in ad code using JavaScript.
Listing 8-9. A localStorage Site Event Example (Ad)
//iOS Site Events - local storage technique - platform.
function setiOSiteEvent (ad, placement, campaign, publisher) {
var m = new Date().getMonth()
var d = new Date().getDate();
var y = new Date().getFullYear();
var dom = window.location.href;
Search WWH ::

Custom Search