Integration

NPM

npm i @mapp-intelligence/node
BASH

Configuration

const mappIntelligenceConfig = new MappIntelligenceConfig()
	.setTrackId("111111111111111")
	.setTrackDomain("analytics01.wt-eu02.net")
	.setDomain([])
	.addDomain("")
	.setUseParamsForDefaultPageName([])
	.addUseParamsForDefaultPageName("")

    .setContainsInclude(new ArrayList<String>())
    .addContainsInclude("")
    .setContainsExclude(new ArrayList<String>())
    .addContainsExclude("")
    .setMatchesInclude(new ArrayList<String>())
    .addMatchesInclude("")
    .setMatchesExclude(new ArrayList<String>())
    .addMatchesExclude("")
	
	.setLogger(null)
	.setLogLevel(MappIntelligenceLogLevel.ERROR)
	.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("")
	.setClientHintUserAgent("")
	.setClientHintUserAgentFullVersionList("")
	.setClientHintUserAgentMobile("")
	.setClientHintUserAgentModel("")
	.setClientHintUserAgentPlatform("")
	.setClientHintUserAgentPlatformVersion("")
	.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
setContainsIncludeArray<string>Specify the strings that must be contained in the request URL to measure the request.emptyno
addContainsIncludestringSpecify the string that must be contained in the request URL to measure the request.emptyno
setContainsExcludeArray<string>Specify the strings that must be contained in the request URL to not measure the request.emptyno
addContainsExcludeRegExpSpecify the string that must be contained in the request URL to not measure the request.emptyno
setMatchesIncludeArray<RegExp>Specify the regular expressions that must be match the request URL to measure the request.emptyno
addMatchesIncludeRegExpSpecify the regular expression that must be match the request URL to measure the request.emptyno
setMatchesExcludeArray<RegExp>Specify the regular expressions that must be match the request URL to not measure the request.emptyno
addMatchesExcludestringSpecify the regular expression that must be match the request URL to not measure the request.emptyno
setLoggerMappIntelligenceLoggerActivates the debug mode. The debug mode sends messages your own LoggerClass (see MappIntelligenceLogger).nullno
setLogLevelstring

Specify the debug log level:

  • NONE: no logs
  • FATAL: fatal errors
  • ERROR: errors leading to data loss or break code
  • WARN: errors that can affect data quality
  • INFO:  general info on configuration and send status
  • DEBUG: general info on request sendout and queue status
ERRORno
setDeactivatebooleanDeactivate the tracking functionality.falseno
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
setClientHintUserAgentstringEnter the origin Client Hint header for "sec-ch-ua" (see How can I make my website ready for Google Chrome's Client Hints? and Information on Google Chrome User-Agent Client Hints for more details).emptyno
setClientHintUserAgentFullVersionListstringEnter the origin Client Hint header for "sec-ch-ua-full-version-list" (see How can I make my website ready for Google Chrome's Client Hints? and Information on Google Chrome User-Agent Client Hints for more details).emptyno
setClientHintUserAgentMobilestringEnter the origin Client Hint header for "sec-ch-ua-mobile" (see How can I make my website ready for Google Chrome's Client Hints? and Information on Google Chrome User-Agent Client Hints for more details).emptyno
setClientHintUserAgentModelstringEnter the origin Client Hint header for "sec-ch-ua-model" (see How can I make my website ready for Google Chrome's Client Hints? and Information on Google Chrome User-Agent Client Hints for more details).emptyno
setClientHintUserAgentPlatformstringEnter the origin Client Hint header for "sec-ch-ua-platform" (see How can I make my website ready for Google Chrome's Client Hints? and Information on Google Chrome User-Agent Client Hints for more details).emptyno
setClientHintUserAgentPlatformVersionstringEnter the origin Client Hint header for "sec-ch-ua-platform-version" (see How can I make my website ready for Google Chrome's Client Hints? and Information on Google Chrome User-Agent Client Hints for more details).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,
        "logLevel": "DEBUG",
        "domain": [],
        "useParamsForDefaultPageName": [],
        "containsInclude": [],
        "containsExclude": [],
        "matchesInclude": [],
        "matchesExclude": []
    },
    "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, MappIntelligenceLogLevel} from '@mapp-intelligence/node';

module.exports = {
    tracking: {
        trackId: '111111111111111',
        trackDomain: 'analytics01.wt-eu02.net',
        deactivate: false,
        debug: false,
        logLevel: MappIntelligenceLogLevel.DEBUG,
        domain: [],
        useParamsForDefaultPageName: [],
        containsInclude: [],
        containsExclude: [],
        matchesInclude: [],
        matchesExclude: []
    },
    consumer: {
        consumerType: MappIntelligenceConsumerType.FILE,
        filePath: '',
        filePrefix: '',
        maxAttempt: 1,
        attemptTimeout: 100,
        maxBatchSize: 50,
        maxQueueSize: 1000,
        maxFileLines: 10000,
        maxFileDuration: 1800000,
        maxFileSize: 25165824,
        forceSSL: true
    }
};
JS