1C-Bitrix Integration with Pushwoosh: Push Notifications and Tags
Imagine: your 1C-Bitrix online store has 50,000 registered users, but the repeat purchase conversion rate is only 12%. You implement push notifications via direct integration with FCM — and a month later you realize: a lot of code was written in vain. Segmentation doesn't work, you lack analytics, and supporting mobile platforms requires separate solutions. We've faced this more than once. For example, for a chain of electronics stores, integrating Pushwoosh instead of pure FCM reduced setup time from 8 to 2 days and enabled personalized notifications without custom development. Budget savings reached up to 40%, and the result was a 30% increase in repeat purchases in the first month. Order a free audit — we'll assess your project.
Pushwoosh is a push notification service built on top of FCM and APNs. It provides a unified API for web push, Android, iOS, and Huawei. Built-in segments, A/B tests, and analytics save hours of development. SDK load time is under 1 second. Our experience: we've integrated Pushwoosh with Bitrix for 10+ projects, reducing labor costs by 3 times compared to pure FCM. Pushwoosh processes notifications faster thanks to optimized routing.
How Pushwoosh simplifies sending push notifications
Unlike direct work with FCM and APNs, Pushwoosh handles routing and device management for you. You only need to link the Pushwoosh hwid (hardware ID) to the Bitrix user. A single user may have multiple devices. The interaction scheme: the Pushwoosh SDK obtains hwid and registers the device, then via API we bind hwid to USER_ID. When an event occurs (order, promotion), PHP code sends a request to the Pushwoosh API, which delivers the notification to all user devices. Up to 70% of users subscribe to push — higher than email newsletters.
Web SDK Initialization
The code below is standard for any Bitrix project. Note: autoSubscribe: false — subscription is requested manually on click; this increases conversion and complies with 54-FZ (user consent). Also place the service worker file /pushwoosh-service-worker.js in the site root with the content importScripts('https://cdn.pushwoosh.com/webpush/v3/pushwoosh-service-worker.js');.
<script src="https://cdn.pushwoosh.com/webpush/v3/pushwoosh-web-notifications.js"></script>
<script>
var Pushwoosh = Pushwoosh || [];
Pushwoosh.push(['init', {
logLevel: 'error',
applicationCode: 'XXXXX-YYYYY',
safariWebsitePushID: 'web.com.example.shop',
defaultNotificationTitle: 'Магазин Пример',
defaultNotificationImage: 'https://example.com/push-icon.png',
autoSubscribe: false,
serviceWorkerUrl: '/pushwoosh-service-worker.js',
}]);
Pushwoosh.push(function(api) {
api.onReady(function() {
api.getHWID().then(function(hwid) {
if (hwid) {
registerPushwooshDevice(hwid);
}
});
});
});
function registerPushwooshDevice(hwid) {
fetch('/local/api/pushwoosh/register', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Bitrix-Csrf-Token': BX.bitrix_sessid()
},
body: JSON.stringify({ hwid: hwid, platform: 'web' })
});
}
document.getElementById('subscribe-push').addEventListener('click', function() {
Pushwoosh.push(function(api) {
api.subscribe().then(function() {
Pushwoosh.push(function(api) {
api.getHWID().then(registerPushwooshDevice);
});
});
});
});
</script>
Storing hwid and PHP client for Pushwoosh API
We use a highload block table PushwooshDeviceTable to store mappings. Example PHP client:
class PushwooshService
{
private string $appCode;
private string $apiAccessToken;
private string $apiUrl = 'https://cp.pushwoosh.com/json/1.3/';
public function createMessage(array $recipientHwids, string $content, array $extra = []): array
{
$payload = [
'request' => [
'application' => $this->appCode,
'auth' => $this->apiAccessToken,
'notifications' => [[
'send_date' => 'now',
'ignore_user_timezone' => false,
'content' => $content,
'devices' => $recipientHwids,
'data' => $extra['data'] ?? [],
'ios_title' => $extra['title'] ?? '',
'android_header' => $extra['title'] ?? '',
'link' => $extra['url'] ?? '',
]],
],
];
return $this->request('createMessage', $payload);
}
public function sendMessageToUser(int $userId, string $content, string $title = '', string $url = ''): void
{
$hwids = PushwooshDeviceTable::getHwidsByUserId($userId);
if (empty($hwids)) return;
$this->createMessage($hwids, $content, ['title' => $title, 'url' => $url]);
}
public function createMessageByTag(string $tagName, string $tagValue, string $content): array
{
$payload = [
'request' => [
'application' => $this->appCode,
'auth' => $this->apiAccessToken,
'notifications' => [[
'send_date' => 'now',
'content' => $content,
'conditions' => [[$tagName, 'EQ', $tagValue]],
]],
],
];
return $this->request('createMessage', $payload);
}
private function request(string $method, array $data): array
{
$ch = curl_init($this->apiUrl . $method);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
return $response ?? [];
}
}
Pushwoosh tags for segmentation
Pushwoosh supports tags — custom device attributes. This allows sending notifications by segments without passing a list of hwids.
public function setUserTags(string $hwid, int $userId): void
{
$user = \Bitrix\Main\UserTable::getById($userId)->fetch();
$tags = [];
$groups = \CUser::GetUserGroup($userId);
if (in_array(7, $groups)) {
$tags[] = ['tagName' => 'loyalty_level', 'tagValue' => 'gold'];
}
if (!empty($user['PERSONAL_CITY'])) {
$tags[] = ['tagName' => 'city', 'tagValue' => $user['PERSONAL_CITY']];
}
$totalOrders = $this->getUserOrdersTotal($userId);
$tags[] = ['tagName' => 'orders_total', 'tagValue' => (int)$totalOrders];
$this->request('setTags', [
'request' => [
'application' => $this->appCode,
'auth' => $this->apiAccessToken,
'tags' => $tags,
'hwid' => $hwid,
],
]);
}
Handling events from Bitrix
AddEventHandler('sale', 'OnSaleStatusOrder', function(string $statusId, \Bitrix\Sale\Order $order) {
$userId = (int)$order->getUserId();
$notifications = [
'O' => ['Заказ #' . $order->getField('ACCOUNT_NUMBER'), 'Заказ принят, передаём в обработку'],
'D' => ['Заказ отправлен', 'Посылка уже в пути — отслеживайте доставку'],
'F' => ['Заказ выполнен', 'Спасибо за покупку! Оставьте отзыв — нам важен ваш опыт'],
];
if (!isset($notifications[$statusId])) return;
[$title, $content] = $notifications[$statusId];
$url = '/personal/order/detail/' . $order->getField('ACCOUNT_NUMBER') . '/';
(new PushwooshService())->sendMessageToUser($userId, $content, $title, $url);
});
Statistics and Inbox
Pushwoosh provides an API for statistics (getStats) and inbox notifications (getInboxMessages) — a list of recent pushes the user may have missed. Inbox is displayed in the personal account. JavaScript code to get inbox:
Pushwoosh.push(function(api) {
api.getInboxMessages().then(function(messages) {
renderInbox(messages);
});
});
What advantages does Pushwoosh offer over direct FCM integration?
| Criteria | Direct FCM | Pushwoosh |
|---|---|---|
| Unified API for all platforms | No (separate Web, Android, iOS) | Yes |
| Built-in segmentation | No | Yes (tags, groups) |
| A/B tests | No | Yes |
| Inbox notifications | No | Yes |
| Setup time (person-days) | 5–7 | 1–2 |
Common integration mistakes
- Not storing hwid for unauthenticated users — notifications will not reach after registration.
- Sending notifications without consent check (requires 54-FZ). Use
autoSubscribe: false. - Ignoring tags: without them, segmentation is impossible — all users receive the same messages.
- Forgetting the service worker for web push — notifications do not arrive on closed browser.
Contact us for a consultation on integration — we'll help you avoid these mistakes.
What is included in the work
- Audit of current Bitrix architecture (infoblocks, events, users)
- API documentation and data schemas
- Pushwoosh SDK setup (Web, Android, iOS)
- PHP client implementation with full method coverage (sendMessage, setTags, getStats)
- Integration with events (orders, registrations, cart)
- User tagging and segment creation
- Inbox setup and display in personal account
- Team training (1–2 hours)
- Technical support 1 month after release
How we implement Pushwoosh in Bitrix
The integration process is staged:
- Analytics: examine data scheme, events, user groups.
- Design: define hwid storage structure, tags, send scenarios.
- Implementation: write PHP client, JS code, configure SDK.
- Testing: check delivery on all platforms, segmentation, scenarios.
- Deploy: roll out to production, update service worker.
Approximate timelines
| Task | Time |
|---|---|
| SDK initialization, hwid storage | 2–3 days |
| PHP API client, device table | 2–3 days |
| Sending by order events | 2–3 days |
| Tags and segmentation | 2–3 days |
| Inbox, statistics, management in personal account | 3–5 days |
| Full package (web + mobile) | 3–4 weeks |
Get a consultation — we'll evaluate your project and provide accurate timelines for your architecture. Leave a request, and we'll contact you.







