Setting Up QR Codes for 1C-Bitrix Catalog: Redirects and Analytics

Setting Up QR Codes for 1C-Bitrix: Redirects and Analytics We set up QR codes for online stores on 1C-Bitrix so that your offline channel generates measurable sales. A typical scenario: you printed 1000 labels with QR codes, but a month later the catalog structure changed—all links broke. Our eng

Our competencies:

Frequently Asked Questions

Setting Up QR Codes for 1C-Bitrix: Redirects and Analytics

We set up QR codes for online stores on 1C-Bitrix so that your offline channel generates measurable sales. A typical scenario: you printed 1000 labels with QR codes, but a month later the catalog structure changed—all links broke. Our engineers solve this at the design stage by choosing the right URL strategy—by article or product ID. Over many years, we have implemented more than 30 projects integrating QR codes into trade catalogs—from small online stores to chains with 50,000 products. In this article, we break down which technical solutions work in production, how to avoid broken links, and why caching is critical for thousands of products. If you need a ready-made setup, contact us—we will estimate the project within 1 day.

A warehouse worker scans a QR code on a box and lands on the product page in the catalog. A marketer prints a QR on a price tag in an offline store—the customer scans and sees reviews, specs, and a "Buy" button. The task is technically simple, but the implementation details determine whether the system will work stably with thousands of products.

Which URL to Choose for the QR Code?

A QR code is an encoded URL. The question is which URL to encode so that it does not break when the catalog structure changes.

Direct link to product (https://shop.by/catalog/product/artikul-123/)—works until the SEO URL changes. Rename a catalog section—all printed QR codes become broken.

Redirect by ID (https://shop.by/qr/1234/)—more reliable. A PHP page or handler in urlrewrite.php is created that, based on the product ID, gets the current URL via CIBlockElement::GetByID() and performs a 301 redirect. The QR code does not depend on the catalog structure.

Redirect by XML_ID or article (https://shop.by/qr/?sku=ART-0042)—the best option for 1C integration, where the article is the main identifier. According to Bitrix documentation, the API allows searching for an element by any property. The handler looks for the element by the ARTICLE property and redirects.

Link Type Reliability When to Use
Direct URL Low (breaks on SEO change) Temporary promotions where catalog is not edited
Redirect by ID High (independent of SEO) Stable QR codes on permanent media
Redirect by article Very high (resistant to moves) 1C integration, frequent catalog updates

How to Speed Up QR Code Generation?

On the server, QR codes are generated with a PHP library. Two working options:

  • chillerlan/php-qrcode—compact, no dependencies, generates SVG and PNG.
  • endroid/qr-code—more features (logo inside QR, colors), but heavier.

Install via Composer: composer require chillerlan/php-qrcode. Generation in the catalog.element component: in result_modifier.php, add code that creates an SVG string of the QR for the current product. The SVG is embedded into the template via $arResult['QR_CODE_SVG'].

For bulk generation (catalog printing, labels), create a separate page /admin/qr-export/ that generates a PDF with QR codes for selected products. The TCPDF or Dompdf library handles the task.

Caching and Performance

Generating one QR code takes 5–15 ms. On a catalog page with 30 products, that's up to 450 ms just for QR codes. Solution: generate the QR once and save it as a file in /upload/qr/{ELEMENT_ID}.svg. When the product URL changes (event OnAfterIBlockElementUpdate), delete the file so that a new one is generated on the next request.

Optimization example: with a catalog of 10,000 products, server time savings reach up to 80%

Without caching, each time the product list is viewed, 10,000 QR codes would be regenerated. With caching, it's only on first access or after a product update. This reduces server load and speeds up page loading.

UTM Parameters and Analytics

Add UTM parameters to the URL inside the QR: ?utm_source=qr&utm_medium=offline&utm_campaign=price_tag. This allows tracking in Yandex.Metrica and Google Analytics how many conversions offline media generate. The parameters do not affect the redirect—the handler simply passes them through.

How the Turnkey Setup Works?

Stage Action Result
Analysis Study catalog structure and requirements Choose URL strategy (article or ID)
Development Create redirect handler and caching Stable QR codes
Integration Generate QR on product page (SVG) + bulk PDF export Ready files for printing
Testing Check redirects, UTM, performance Error-free operation
Deployment Upload to production server, documentation 30-day support

What Is Included in the Turnkey QR Setup?

The comprehensive setup includes:

  • Analysis of the current URL structure and selection of the optimal strategy (article or ID)
  • Development of a redirect handler with caching
  • Integration of QR code generation on the product page (SVG embed)
  • Setup of bulk QR export to PDF for printing on price tags and labels
  • Addition of UTM parameters with the ability to change campaigns without reprinting QR codes
  • User documentation and instructions for marketers
  • Free support for 30 days after launch

Order the QR code setup—we will calculate the cost within 1 working day. Get a ready-made solution with a guarantee of stable operation for any catalog size. Contact us for a consultation.