--- title: "Node.js Library" slug: "nodejs-library" description: "Send tracking data from your Node.js backend to Mapp Intelligence: server-side, hybrid and mission-critical setups with the @mapp-intelligence/node library." status: "update" updated: 2026-11-02T14:57:25Z published: 2026-11-02T14:57:25Z canonical: "docs.mapp.com/nodejs-library" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Node.js Library The Mapp Intelligence Node.js Library provides a server-side integration for sending tracking data directly from your backend to Mapp Intelligence. It enables full or partial server-side tracking, for example to record orders, confirmations, or other events without relying on client-side scripts. Before using the Node.js Library, make sure you have read the [Server-to-Server Basics](/v1/docs/server-to-server) section. That page explains the general tracking structure, request format, parameters, and session handling logic that apply to all server-to-server integrations. --- ## Overview | **Aspect** | **Description** | | --- | --- | | Library name | @mapp-intelligence/node | | Purpose | Server-side data collection for Mapp Intelligence | | Use cases | Product, order, shipment, and application tracking | | Integration | npm (see [Integration & Configuration](/v1/docs/nodejs-integration-and-configuration)) | --- ## Key Concepts The Node.js library can be used in different tracking setups depending on your data protection requirements and system architecture. Each approach determines how data is collected and forwarded to Mapp Intelligence. --- ### 1. Pure Server-Side Tracking All tracking requests are created and sent from your server using the Node.js library. This approach does not rely on any client-side scripts or cookies and is ideal for environments with strict data protection or limited browser access. Key Features: - All consumer types are supported (FILE, HTTP_CLIENT, or custom). - A unique user identifier (everID) must be passed manually (via getUserIdCookie() or a custom ID). - Tracking data is sent directly to the track server without browser dependencies. - Depending on browser and caching behavior, this approach may slightly affect page impression counts. #### Tracking Considerations Pure server-side tracking or the use of the server-side library to track all page requests might affect the number of page impressions if one of the following conditions is true: - **Preloading of pages in search results** Some browsers (for example, Safari or Google Chrome) preload websites in the background when they appear in search results. Since this generates a server call, a page impression may be counted even if the user never opened the page. This can lead to increased page impressions, higher bounce rates, and shorter visit durations. - **Caching of pages** If pages are cached in the browser to improve performance, a page impression may not be tracked if the cache prevents a new server call. This can slightly reduce the total number of tracked page impressions and may affect path analyses for previous and following pages. #### Configuration Example ```javascript const config = new MappIntelligenceConfig()    .setTrackDomain("analytics01.wt-eu02.net")    .setTrackId("111111111111111")    .setConsumerType(MappIntelligenceConsumerType.FILE); ``` --- ### 2. Hybrid Tracking (Pixel + Node.js Library) Combining the Node.js library with the Mapp tracking pixel allows you to use both client- and server-side data sources. This setup provides maximum flexibility, for example tracking user interactions via the pixel while recording page-related data via the server. Key Features: - Data is collected by both the tracking pixel and the Node.js library. - No custom track domain is required. - Pixel requests are forwarded to the server library, which sends them via the FILE consumer to the track server. #### Configuration Example ```javascript const config = new MappIntelligenceConfig()    .setTrackDomain("analytics01.wt-eu02.net")    .setTrackId("111111111111111")    .setConsumerType(MappIntelligenceConsumerType.FILE); ``` --- ## 3. Tracking Mission-Critical Information Use the Node.js library exclusively for mission-critical data (for example, orders, confirmations, or shipping events), while the tracking pixel continues to collect less sensitive data. Key Features: - Reduces load on the customer’s server. - The pixel sends regular browser data directly to the track server. - The Node.js library uses the HTTP_CLIENT consumer for the critical data. To send it right away, create one tracking instance per request and `await close()` it at the end of the request, or call `await flush()` after `track()`. A max batch size of 1 does not send a request immediately; a long-lived instance can use `setRequestInterval()`. #### Configuration Example ```javascript const config = new MappIntelligenceConfig()    .setTrackDomain("analytics01.wt-eu02.net")    .setTrackId("111111111111111")    .setConsumerType(MappIntelligenceConsumerType.HTTP_CLIENT)    .setMaxAttempt(3)    .setAttemptTimeout(100); const mappIntelligence = new MappIntelligenceTracking(config); try {    await mappIntelligence.track(new MappIntelligenceDataMap()        .page(new MappIntelligencePage('en.checkout.confirmation'))        .order(new MappIntelligenceOrder(360.93))); } finally {    // sends the request now    await mappIntelligence.close(); } ``` --- ### 4. Server Library as Track Domain All requests are collected through the tracking pixel but routed via your server to Mapp Intelligence. This approach hides the Mapp track domain from the browser and allows full client-side functionality while retaining server control. > [!TIP] > **Recommendation** > > Use the [MappIntelligenceHybrid](/v1/docs/nodejs-classes) class with [Cronjob](/v1/docs/nodejs-cron-job) logic for this use case