Integration and Configuration
Integration
Download
https://github.com/mapp-digital/Mapp-Intelligence-Node-Tracking/releases
BASH
NPM
npm i @mapp-intelligence/node
BASH
Configuration
const mappIntelligenceConfig = new MappIntelligenceConfig()
.setTrackId("111111111111111")
.setTrackDomain("analytics01.wt-eu02.net")
.setDomain([])
.addDomain("")
.setUseParamsForDefaultPageName([])
.addUseParamsForDefaultPageName("")
.setLogger(null)
.setDebug(false)
.setDeactivate(false)
.setConsumerType("")
.setConsumer(null)
.filePath("/tmp")
.filePrefix("MappIntelligenceRequests")
.setMaxAttempt(1)
.setAttemptTimeout(100)
.setMaxBatchSize(50)
.setMaxQueueSize(1000)
.setMaxFileLines(10000)
.setMaxFileDuration(30 * 60 * 1000)
.setMaxFileSize(24 * 1024 * 1024)
.setForceSSL(true)
.setUserAgent("")
.setRemoteAddress("")
.setReferrerURL("")
.setRequestURL("")
.setCookie({})
.addCookie("", "");
JS
Methods | Type | Notes | Default | Mandatory |
---|---|---|---|---|
setTrackId | string | Enter your Mapp Intelligence track ID provided by Mapp. | empty | yes |
setTrackDomain | string | Enter your Mapp Intelligence tracking URL. | empty | yes |
setDomain | Array<string | RegExp> | Specify the domains you do not want to identify as an external referrer (e.g. your subdomains). | empty | no |
addDomain | string | RegExp | Specify the domain you do not want to identify as an external referrer (e.g. your subdomains). | empty | no |
setUseParamsForDefaultPageName | Array<string> | Includes specific URL parameter(s) in the default page name. | empty | no |
addUseParamsForDefaultPageName | string | Includes specific URL parameter in the default page name. | empty | no |
setLogger | IMappIntelligenceLogger | Activates the debug mode. The debug mode sends messages your own LoggerClass (see IMappIntelligenceLogger). | null | no |
setDebug | boolean | Activates the default debug mode. The debug mode sends messages via console.log | false | no |
setDeactivate | boolean | Deactivate the tracking functionality. | false | no |
setConsumerType | string | Specify the consumer to use for data transfer to Intelligence (HTTP_CLIENT, FORL_CURL, FILE or CUSTOM). | HTTP_CLIENT | no |
setConsumer | IMappIntelligenceConsumer | Specify the custom consumer to use for data transfer to Intelligence (see IMappIntelligenceConsumer). | null | |
setFilePath | string | Enter the path to your request logging file. This is only relevant when using file consumer. | tmpdir() | no |
setFilePrefix | string | Enter the prefix from your request logging files. This is only relevant when using file consumer. | MappIntelligenceRequests | no |
setMaxAttempt | number | Specify the number of resend attempts. After the maxAttempts have been reached, the requests will be deleted even if the sending failed. | 1 | no |
setAttemptTimeout | number | Specify the interval of request resend in milliseconds. | 100 | no |
setMaxBatchSize | number | Specify the maximum request number per batch. | 50 | no |
setMaxQueueSize | number | Specify the maximum number of requests saved in the queue. | 1000 | no |
setMaxFileLines | number | The maximum number of maximal lines per file. | 10 * 1000 | no |
setMaxFileDuration | number | The maximum number of maximal file duration. | 30 * 60 * 1000 | no |
setMaxFileSize | number | The maximum number of maximal file size. | 24 * 1024 * 1024 | no |
setForceSSL | boolean | Sends every request via SSL. | true | no |
setUserAgent | string | Enter the origin client HTTP user agent string. | empty | no |
setRemoteAddress | string | Enter the origin client Remote address (ip). | empty | no |
setReferrerURL | string | Enter the origin client HTTP referrer URL. | empty | no |
setRequestURL | string | Enter the origin client HTTP request URL. | empty | no |
setCookie | {[key: string]: string} | Enter a map of all origin client cookies. | empty | no |
addCookie | string | Enter a origin client cookie (key, value). | empty | no |
const mappIntelligenceConfig = new MappIntelligenceConfig(
"path/to/your/json/file/config.json"
);
JS
{
"tracking": {
"trackId": "111111111111111",
"trackDomain": "analytics01.wt-eu02.net",
"deactivate": false,
"debug": false,
"domain": [],
"useParamsForDefaultPageName": []
},
"consumer": {
"consumerType": "FILE",
"filePath": "",
"filePrefix": "",
"maxAttempt": 1,
"attemptTimeout": 100,
"maxBatchSize": 50,
"maxQueueSize": 1000,
"maxFileLines": 10000,
"maxFileDuration": 1800000,
"maxFileSize": 25165824,
"forceSSL": true
}
}
JS
const mappIntelligenceConfig = new MappIntelligenceConfig(
"path/to/your/js/file/config.js"
);
JS
import {MappIntelligenceConsumerType} from '@mapp-intelligence/node';
module.exports = {
tracking: {
trackId: '111111111111111',
trackDomain: 'analytics01.wt-eu02.net',
deactivate: false,
debug: false,
domain: [],
useParamsForDefaultPageName: []
},
consumer: {
consumerType: MappIntelligenceConsumerType.FILE,
filePath: '',
filePrefix: '',
maxAttempt: 1,
attemptTimeout: 100,
maxBatchSize: 50,
maxQueueSize: 1000,
maxFileLines: 10000,
maxFileDuration: 1800000,
maxFileSize: 25165824,
forceSSL: true
}
};
JS