Chapter 19. Advertising Lexicon

There are a number of voodoo words and concepts in LJ::ads() and the related advertising code. This document aims to de-mystify them. This document might be inaccurate. If so, please fix it.

Advertising Elements

type akactx

A type/context is either “app” or “journal”.

LJ::ads(type => $type)
LJ::run_hook(“should_show_ad”, { ctx => $type });

Elements like “BML-App-Confirm”. This uniquely identifies a place in the code where an ad can go (and be turned on/off).


Identical to orient, without leading “BML-”, if present.


How to behave for a given orient/pagetype(?), basically a hashref of:

    adunit => “skyscraper”,     # leaderboard, etc.
    target => “user”,           # content, etc.
%AD_TYPE”, akaadunit
    skyscraper => { width => 160, height => 600 
LJ::ads(position => $pos)