Setting up banner management in 1C-Bitrix

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1189
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    813
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    657
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Setting up Banner Management on 1C-Bitrix

Banners on Bitrix can be implemented two ways: through built-in advertising module or through infoblock. The advertising module has specialized functionality for ad shows, but requires "Small Business" edition and above. Infoblock approach is simpler and works on any edition.

advertising module: when it's needed

The advertising module (/bitrix/modules/advertising/) provides: banner rotation, show limitation per user/session, click and impression statistics, A/B testing of banners. All stored in tables b_adv_banner, b_adv_contract, b_adv_stat_day.

Component bitrix:advertising.banner is called in template specifying contract (ad campaign) and banner type. System automatically selects needed banner from contract by show weights.

Use advertising if real show statistics or frequency capping of one banner is needed.

Infoblock approach: simpler for editors

For most corporate sites, not ad campaigns but just "slider on homepage" and "banners in sidebar" are needed. Infoblock with banners is simpler to manage:

Create infoblock banners. Element properties:

  • BANNER_ZONE — type "List", values: main_slider, sidebar, category_top. Binding to position on site
  • LINK_URL — click destination URL
  • LINK_TARGET_self / _blank
  • IMAGE — image (or use standard PREVIEW_PICTURE)
  • IMAGE_MOBILE — separate image for mobile
  • REGIONS — for multi-regional sites
  • ACTIVE_FROM / ACTIVE_TO — standard fields for temporary show

In component bitrix:news.list on needed place in template request banners with filter by BANNER_ZONE:

$APPLICATION->IncludeComponent('bitrix:news.list', 'banners', [
    'IBLOCK_ID' => BANNERS_IBLOCK_ID,
    'FILTER' => ['PROPERTY_BANNER_ZONE' => 'main_slider'],
    'SORT_BY1' => 'SORT',
    'CACHE_TYPE' => 'A',
    'CACHE_TIME' => 1800,
]);

Managing banners through visual editor

For editor convenience — bind banners to site sections through IBLOCK_SECTION_ID. Then in admin interface editor goes to needed catalog or page section and sees only banners tied to it.

Alternative: Bitrix has "Content Manager" (/bitrix/admin/content.php) for managing page content without entering full admin panel. Banner infoblock can be added to this interface for non-technical editors.

Temporary banners and scheduling

ACTIVE_FROM and ACTIVE_TO fields allow scheduling banner show. But component cache may "freeze" outdated banner. Solutions:

  1. Set CACHE_TIME less than banner change interval
  2. Configure agent that clears cache when ACTIVE_TO expires — through BXClearCache() with path to component cache
  3. Use CACHE_TYPE = 'N' for banner components with frequent change — load is small, and banner cache often not needed

Click statistics without advertising module

For simple click tracking on banners from infoblock — AJAX handler. On banner click send request to /local/ajax/banner_click.php?id=XXX, increment counter in element property through CIBlockElement::SetPropertyValues(). Cheap and sufficient for basic analytics.