Integration and Configuration

Prev Next

Integration

NPM

npm i @mapp-intelligence/node

Configuration

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

    .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("", "");

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

setActivateAdvancedPermission

boolean

Enable if you need to differentiate between additional usage options for the tracked data, e.g., only to your Intelligence instance or to both Intelligence and Engage.

false

no

setAdvancedPermissionCategory

number

  • 0 (default): only Intelligence

  • 3: Intelligence and Engage

0

no

setContainsInclude

Array<string>

Specify the strings that must be contained in the request URL to measure the request.

empty

no

addContainsInclude

string

Specify the string that must be contained in the request URL to measure the request.

empty

no

setContainsExclude

Array<string>

Specify the strings that must be contained in the request URL to not measure the request.

empty

no

addContainsExclude

RegExp

Specify the string that must be contained in the request URL to not measure the request.

empty

no

setMatchesInclude

Array<RegExp>

Specify the regular expressions that must be match the request URL to measure the request.

empty

no

addMatchesInclude

RegExp

Specify the regular expression that must be match the request URL to measure the request.

empty

no

setMatchesExclude

Array<RegExp>

Specify the regular expressions that must be match the request URL to not measure the request.

empty

no

addMatchesExclude

string

Specify the regular expression that must be match the request URL to not measure the request.

empty

no

setLogger

MappIntelligenceLogger

Activates the debug mode. The debug mode sends messages your own LoggerClass (see MappIntelligenceLogger).

null

no

setLogLevel

string

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

ERROR

no

setDeactivate

boolean

Deactivate the tracking functionality.

false

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

setClientHintUserAgent

string

Enter 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).

empty

no

setClientHintUserAgentFullVersionList

string

Enter 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).

empty

no

setClientHintUserAgentMobile

string

Enter 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).

empty

no

setClientHintUserAgentModel

string

Enter 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).

empty

no

setClientHintUserAgentPlatform

string

Enter 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).

empty

no

setClientHintUserAgentPlatformVersion

string

Enter 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).

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"
);
{
    "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
    }
}
const mappIntelligenceConfig = new MappIntelligenceConfig(
	"path/to/your/js/file/config.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
    }
};