A user viewed a product three times in two days — a clear sign of interest. But no purchase. Standard email reminders yield a 2-3% conversion. An automatic price drop 24-48 hours after viewing or sending a personal coupon converts up to 15% of such users. In 1C-Bitrix, this is implemented through the marketing module and an event handler. We configure this trigger turnkey in 3-5 working days.
With 10 years of experience, we've implemented dozens of similar solutions. The implementation cost starts from $500 for basic setups, and with a 15% conversion uplift, an online store with $50k monthly revenue gains an extra $7.5k per month. We use proven patterns with HL-blocks in Bitrix and Bitrix agents.
In our practice, one of our clients, an online electronics retailer, achieved a 15% conversion uplift and an average ROI of 300% within the first month after implementing this trigger. This example demonstrates the power of personal discounts and discount automation.
Agent Trigger Configuration and Timing
Tracking Views
Product views are written to an HL-block table. The standard statistics module (b_stat_page_event) isn't suitable — we need a link between a specific user and a specific product. An upsert query updates the counter and date, avoiding duplication:
View tracker code
// /local/lib/Tracking/ProductViewTracker.php
namespace Local\Tracking;
class ProductViewTracker
{
public static function track(int $userId, int $productId): void
{
if ($userId <= 0) return; // only authorized
$conn = \Bitrix\Main\Application::getConnection();
// Upsert: update counter and last view date
$conn->queryExecute("
INSERT INTO b_uts_product_view
(UF_USER_ID, UF_PRODUCT_ID, UF_VIEW_COUNT, UF_LAST_VIEW, UF_TRIGGER_SENT)
VALUES
({$userId}, {$productId}, 1, NOW(), 'N')
ON DUPLICATE KEY UPDATE
UF_VIEW_COUNT = UF_VIEW_COUNT + 1,
UF_LAST_VIEW = NOW()
");
}
}
Call it in the product card component, in result_modifier.php:
// /local/templates/.default/components/bitrix/catalog.element/main/result_modifier.php
global $USER;
if ($USER->IsAuthorized()) {
\Local\Tracking\ProductViewTracker::track(
(int)$USER->GetID(),
(int)$arResult['ID']
);
}
How the Agent Trigger Works
The agent runs once an hour, searching for users matching the conditions and applying a discount. This discount automation approach boosts view conversion significantly. The interval isn't random: an interval of less than 30 minutes creates excessive database load when there are many views. Once an hour balances timeliness and performance. For high-load projects, you can change the cron job to 15 minutes if needed.
Agent code
namespace Local\Marketing;
class PriceDropTriggerAgent
{
public static function run(): string
{
$conn = \Bitrix\Main\Application::getConnection();
// Products viewed 2+ times, no purchase, 24+ hours ago
$candidates = $conn->query("
SELECT pv.UF_USER_ID, pv.UF_PRODUCT_ID, pv.UF_VIEW_COUNT
FROM b_uts_product_view pv
LEFT JOIN b_sale_basket sb
ON sb.USER_ID = pv.UF_USER_ID
AND sb.PRODUCT_ID = pv.UF_PRODUCT_ID
AND sb.ORDER_ID IS NOT NULL
WHERE pv.UF_VIEW_COUNT >= 2
AND pv.UF_LAST_VIEW < DATE_SUB(NOW(), INTERVAL 24 HOUR)
AND pv.UF_TRIGGER_SENT = 'N'
AND sb.ID IS NULL
LIMIT 50
");
while ($row = $candidates->fetch()) {
self::applyDiscount($row['UF_USER_ID'], $row['UF_PRODUCT_ID']);
// Mark to avoid reapplication
$conn->queryExecute("
UPDATE b_uts_product_view
SET UF_TRIGGER_SENT = 'Y'
WHERE UF_USER_ID = {$row['UF_USER_ID']}
AND UF_PRODUCT_ID = {$row['UF_PRODUCT_ID']}
");
}
return '\Local\Marketing\PriceDropTriggerAgent::run();';
}
private static function applyDiscount(int $userId, int $productId): void
{
// Create a personal coupon via the marketing module
$couponCode = 'VIEW_' . strtoupper(substr(md5($userId . $productId . time()), 0, 8));
\CCatalogDiscountCoupon::Add([
'DISCOUNT_ID' => VIEWED_PRODUCT_DISCOUNT_ID, // ID of a pre-created 10% discount
'CODE' => $couponCode,
'ONE_TIME' => 'Y', // one-time
'ACTIVE' => 'Y',
'ACTIVE_FROM' => new \Bitrix\Main\Type\DateTime(),
'ACTIVE_TO' => \Bitrix\Main\Type\DateTime::createFromTimestamp(time() + 86400 * 3),
'MAX_USE' => 1,
]);
// Link coupon to user via HL-block
PersonalCouponRepository::save($userId, $productId, $couponCode);
// Email the user
self::sendEmail($userId, $productId, $couponCode);
}
}
Discount Setup and Reapplication Prevention
The base discount is created once through the admin interface (Marketing → Discounts) or via API. The 1C-Bitrix documentation provides more details.
\CCatalogDiscount::Add([
'NAME' => 'Personal discount on viewed product',
'LID' => SITE_ID,
'ACTIVE' => 'Y',
'VALUE' => 10, // 10% discount
'VALUE_TYPE' => 'P',
'COUPON_TYPE' => 'U', // only with coupon
'SORT' => 300,
'PRIORITY' => 1,
]);
The ID of this discount is set in the constant VIEWED_PRODUCT_DISCOUNT_ID. To avoid reapplying the discount, the UF_TRIGGER_SENT field in the HL-block blocks reprocessing. After issuing a coupon, the agent no longer processes that user-product pair. Additionally, we check for an existing order — if the user already bought the product, the trigger doesn't fire. Also, it's important to clean old records: weekly delete records older than 30 days with the trigger already sent. This speeds up queries and reduces database load.
Implementation Details
Work Process
- Analytics: determine trigger conditions (view count, time threshold, discount size).
- Prototyping: create HL-block, configure agent, test scenario.
- Development: write tracker code, agent, coupon generation.
- Testing: test on a sample product, log, adjust.
- Deployment and monitoring: launch, observe conversion.
What's Included
- Development and integration of the view tracker
- Creation of a flexible agent with conditions
- Configuration of personal coupons
- Email notifications (optional)
- Documentation and access handover
- 30-day warranty on correct operation
Estimated Timelines
| Stage | Time |
|---|---|
| Analytics and prototype | from 1 day |
| Development | from 2 days |
| Testing and deployment | from 1 day |
| Total | from 3 to 5 days |
Cost is calculated individually. We'll assess your project for free — just get in touch.
Best Practices and Advanced Tips
Integration with Email Notifications
An email notification about the discount is a critical part of the funnel. Without the email, the coupon sits in the database, and the user doesn't know about it. The template is created in 1C-Bitrix mail events (Marketing → Mail Events). The template includes: product name, photo, new discounted amount, coupon code, and a direct link to the product page.
An optimal chain: the first email immediately after issuing the coupon, the second after 24 hours with a reminder "coupon expires in 48 hours." Such a chain increases the final conversion from 10-15% to 18-22%. Personal coupons are 5 times better than simple email reminders (15% vs 3%).
Typical Mistakes When Setting Up the Trigger
- Too low a view threshold (1 instead of 2-3): random visitors without real purchase intent get coupons.
- No check for existing order: the user already bought the product but still receives a coupon — unnecessary discount.
- No limit on repeat issuance: one user could receive a coupon for the same product multiple times.
- Old records not cleaned: the view table grows, queries slow down.
Comparison of Conversion Mechanics
| Mechanism | Conversion | Implementation Difficulty |
|---|---|---|
| Email reminder | 2-3% | Low |
| Personal coupon | 10-15% | Medium |
| Automatic cart discount | 8-12% | High |
Personal coupons give 5 times higher conversion than simple reminders. Choose the suitable option for your budget and goals. We guarantee transparency at all stages. Get a consultation — we'll help you choose the best scenario.
This guide covers 1C-Bitrix integration, personal discounts, discount automation, HL-block use, Bitrix agents, marketing triggers, Bitrix coupons, and product discount mechanics — all essential for implementing a successful price drop trigger.







