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
MethodsTypeNotesDefaultMandatory
setTrackIdstringEnter your Mapp Intelligence track ID provided by Mapp.emptyyes
setTrackDomainstringEnter your Mapp Intelligence tracking URL.emptyyes
setDomainArray<string | RegExp>Specify the domains you do not want to identify as an external referrer (e.g. your subdomains).

empty

no
addDomainstring | RegExpSpecify the domain you do not want to identify as an external referrer (e.g. your subdomains).emptyno
setUseParamsForDefaultPageNameArray<string>Includes specific URL parameter(s) in the default page name.emptyno
addUseParamsForDefaultPageNamestringIncludes specific URL parameter in the default page name.emptyno
setLoggerIMappIntelligenceLoggerActivates the debug mode. The debug mode sends messages your own LoggerClass (see IMappIntelligenceLogger).nullno
setDebugbooleanActivates the default debug mode. The debug mode sends messages via console.logfalseno
setDeactivatebooleanDeactivate the tracking functionality.falseno
setConsumerTypestringSpecify the consumer to use for data transfer to Intelligence (HTTP_CLIENT, FORL_CURL, FILE or CUSTOM).HTTP_CLIENTno
setConsumerIMappIntelligenceConsumerSpecify the custom consumer to use for data transfer to Intelligence (see IMappIntelligenceConsumer).null
setFilePathstringEnter the path to your request logging file. This is only relevant when using file consumer.tmpdir()no
setFilePrefixstringEnter the prefix from your request logging files. This is only relevant when using file consumer.MappIntelligenceRequestsno
setMaxAttemptnumberSpecify the number of resend attempts. After the maxAttempts have been reached, the requests will be deleted even if the sending failed.1no
setAttemptTimeoutnumberSpecify the interval of request resend in milliseconds.100no
setMaxBatchSizenumberSpecify the maximum request number per batch.50no
setMaxQueueSizenumberSpecify the maximum number of requests saved in the queue.1000no
setMaxFileLinesnumberThe maximum number of maximal lines per file.10 * 1000no
setMaxFileDurationnumberThe maximum number of maximal file duration.30 * 60 * 1000no
setMaxFileSizenumberThe maximum number of maximal file size.24 * 1024 * 1024no
setForceSSLbooleanSends every request via SSL.trueno
setUserAgentstringEnter the origin client HTTP user agent string.emptyno
setRemoteAddressstringEnter the origin client Remote address (ip).emptyno
setReferrerURLstringEnter the origin client HTTP referrer URL.emptyno
setRequestURLstringEnter the origin client HTTP request URL.emptyno
setCookie{[key: string]: string}Enter a map of all origin client cookies.emptyno
addCookiestringEnter a origin client cookie (key, value).emptyno



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