Random adverts | Top adverts | Bottom adverts
Ad rotation / split testing and alternate content are advanced features. If you don't understand these features you probably don't need them and can therefore ignore this tab. In summary:
- Ad rotation / split testing: You can define multiple adverts for the same ad space which are rotated according to the ratios you define. The percentage of views that each ad will be shows is displated beneath the ratio text box. For example if you define two ads and set both to have a ratio of '50' they will each be shown (roughly) 50% of the time. The numbers don't have to add up to 100 as the ratio is calculated based on the total. e.g. if you have two advert - one is set with a ratio of '1' and the other '3' the ratios will be 25% and 75%. Please remember this isn't strict ad rotation, it is random selection based on ratios so the ratios will be correct over a large sample of ad views, not a small sample.
- Alternate content: This is content that is displayed when ads are blocked for the user. Ads can only be blocked for specific users if you use one of the dynamic modes (mfunc or direct_dynamic). You could use this alternate content to show other content, some kind of layout filler, or even a different type of ad. I've added support for rotation of alternate content as well.
DOCS;
$total_rand_split = adinj_total_split('ad_code_random_', $ops);
$total_rand_alt_split = adinj_total_split('ad_code_random_alt_', $ops);
$total_top_split = adinj_total_split('ad_code_top_', $ops);
$total_top_alt_split = adinj_total_split('ad_code_top_alt_', $ops);
$total_bottom_split = adinj_total_split('ad_code_bottom_', $ops);
$total_bottom_alt_split = adinj_total_split('ad_code_bottom_alt_', $ops);
?>
';
for ($i=1; $i<=5; ++$i){
adinj_add_row_with_text_box('ad_code_random_', $i, 'Ad code', $total_rand_split);
}
adinj_add_row_with_text_box('ad_code_random_alt_', 1, 'Alt content', $total_rand_alt_split);
adinj_add_row_with_text_box('ad_code_random_alt_', 2, 'Alt content', $total_rand_alt_split);
echo '';
adinj_postbox_end();
adinj_postbox_start(__("Top adverts", 'adinj'), 'multiple_top');
echo '';
for ($i=1; $i<=5; ++$i){
adinj_add_row_with_text_box('ad_code_top_', $i, 'Ad code', $total_top_split);
}
adinj_add_row_with_text_box('ad_code_top_alt_', 1, 'Alt content', $total_top_alt_split);
adinj_add_row_with_text_box('ad_code_top_alt_', 2, 'Alt content', $total_top_alt_split);
echo '
';
adinj_postbox_end();
adinj_postbox_start(__("Bottom adverts", 'adinj'), 'multiple_bottom');
echo '';
for ($i=1; $i<=5; ++$i){
adinj_add_row_with_text_box('ad_code_bottom_', $i, 'Ad code', $total_bottom_split);
}
adinj_add_row_with_text_box('ad_code_bottom_alt_', 1, 'Alt content', $total_bottom_alt_split);
adinj_add_row_with_text_box('ad_code_bottom_alt_', 2, 'Alt content', $total_bottom_alt_split);
echo '
';
adinj_postbox_end();
}
function adinj_add_row_with_text_box($name_stem, $num, $title, $total){
$ops = adinj_options();
$name = $name_stem.$num;
$namesplit = $name.'_split';
$percent = adinj_percentage_split($name_stem, $num, $ops, $total);
echo <<
$title $num
|
$percent
|
EOT;
}
?>