Frequency cookie

EmediateAd uses three cookies to store information on which frequency targeted campaigns a visitor has seen:


Frequency groups


Frequency targeted campaigns


Frequency_targeted creatives

The cookies all use the same format:


where type=g in the Frequency group cookie, n in the campaign cookie and c in the creative cookie. Expire is unix cachebuster - 1e9. IDs, frequency and expiry are encoded in an emediate variant of base64 encoding.

An example cookie might look like this:

eas_fr	cO-C-RwUhT:cP-B-JwUhT:cB-F-crrpR:

which is decoded to


Campaign 14 has been seen 2 times and expires at unix time 1327502865 (25/1 2011 08:47:25).

Each frequency cookie can contain up to 200 entries - this means that EmediateAd stores information about up to 200 campaigns, 200 creatives and 200 frequency groups.

New cookie entries are added from the left. Updated cookie entries keep their position in the list.

Example 1

Cookie contains 14-2-<expiry>:15-3-<expiry>

Visitor sees frequency targeted campaign with id 16. The new cookie is


Visitor then sees campaign 14. The new cookie is:


When mod_eas reads the cookie, all entries where the expiry time has already passed are removed:

Example 2

Cookie contains 14-2-<old expiry>:15-3-<expiry>

New cookie is:


When the cookie is full, the rightmost entry is removed from the list. This is not the entry least recently seen, it is the entry least recently added to the list.

Example 3

Cookie is full, and contains …:14-2-<expiry>:15-3-<expiry>

Visitor sees frequency targeted campaign with id 16. The new cookie is


Visitor then sees campaign 14. The new cookie is:


Visitor sees campaign frequency targeted campaign with id 17. The new cookie is:


Note that campaign 14 was removed, even though it was viewed very recently.

This removal policy can be very dangerous on a site where most campaigns are booked with a long expiration time. The worst case scenario is Lifetime: Eternal; then no entries will ever be removed because they have expired and only the “remove from the right” case is used.

This will have the appearance of “random” campaigns being removed from the cookie and the frequency capping being implemented very inconsistently.

To prevent the possibility of reaching the limit of the frequency cookie, Emediate recommends all campaigns are booked with a frequency that at the longest covers the campaign period. The use of Lifetime: Eternal; should be limited to very special cases.
Cxense © 2012 | Support