Additional settings

The Send2CRM client can be used with the default options and requires only the details in the installation script to run. It also provides a number of configurable settings if you wish to fine-tune your implementation.

Applying settings

To ensure the correct timing when making alterations, handle the send2crmLoading event in your own script:

window.addEventListener('send2crmLoading', (evt) => { // Specify send2crm settings. // All values are optional, defaults will be used if not present. send2crm.applySettings({ // Verbose output to the console (default: false). debug: true, // Enable the 'send2crm' Personalization cookie (default: false). personalizationCookie: true, // Timeout before ending an inactive Session, in minutes. //sessionTimeout: 20, // Frequency of identified Visitor sync, in minutes. //syncFrequency: 4, // Paths to the service API endpoints. //apiVisitorPath: '/services/apexrest/send2crm/v1/visitor', //apiFormPath: '/services/apexrest/send2crm/v1/form', // Selector for auto-processing forms. //formSelector: 'form.send2crm-form', // Maximum form file size in bytes (1MB). //maxFileSize: 1 * 1024 * 1024, // Validation message shown on form submission failure. //formFailMessage: 'send2crm form submission failed.', // Specify the <form> attributes that may be used as identifiers. //formIdAttributes: ['name', 'action'], // Form flood control restrictions - set to falsey value to disable. // Minimum time, in seconds, that a standard form should be attached before allowing send. //formMinTime: 4, // Limit number of form submissions allowed. //formRateCount: 3, // Allow one additional form submission every n seconds. //formRateTime: 120, // Listen to form button click for submissions. //formListenOnButton: false, // Maximum storage space to occupy in bytes (4MB). //maxStorage: 4 * 1024 * 1024, // Set true to automatically collect UTM parameters into a cookie. //utmCookie: false, // Determine how Send2CRM will handle visitor ignore flag. ignoreBehavior: 'R', }); });

Available settings

Setting

Default

Description

Setting

Default

Description

sessionTimeout

20

Number of minutes of inactivity before automatically ending a browsing session. An update is sent to the service immediately on session end.

syncFrequency

4

Number of minutes between service updates for identified (and active) visitors.

ignoreBehavior

R

(R)etain: do not remove browser data.
(C)lear: remove data to date, allow future collection.
(D)isable: remove data and disable future collection.

personalizationCookie

false

If true Personalization Segments will be added to a send2crm cookie for website back end use.

utmCookie

false

If true Send2CRM will automatically store UTM parameters in a cookie, and add to all form submissions and sessions.

apiVisitorPath

(Salesforce)

The relative path for sending visitor updates to the service.

apiFormPath

(Salesforce)

The relative path for sending form submissions to the service.

formSelector

form.send2crm-form

Selector for auto-processing forms, suitable for passing to querySelectorAll().

maxFileSize

1048576 (1MB)

Maximum total file size per form submission. If multiple files are allowed the total must fall under this. Files that exceed the limit will not be sent.

formFailMessage

send2crm form submission failed.

Allows overriding the validation message shown when form submissions fail. Set to a false-y value to disable. Implement dynamic custom messages by handling the send2crmFormSubmit event.

formIdAttributes

['name', ‘action’]

The attributes of the <form> element that may be used as unique identifiers.

formMinTime

4 (seconds)

When using Send2CRM to automatically handle forms, any submissions before this time has elapsed will be rejected. (Distinguish bots from real people). 0 to disable.

formRateCount

3

Limit number of form submissions per visitor. 0 to disable submission limiting.

formRateTime

120 (2 minutes)

Allow one additional form submission per formRateTime seconds. Never allows more than formRateCount submissions at once. 0 to disable.

formListenOnButton

false

Set true to have Send2CRM attach a listener to the submit button click for forms. Can be useful when multiple submit event listeners are present.

debug

false

If true additional troubleshooting information will be output to the browser console.

maxStorage

4194304 (4MB)

Maximum browser local storage space to occupy before auto-removing old session data.

Advanced settings

  • ipLookup: the URL of an external IP address lookup service. This service is queried when new sessions are created, and fields from the response are saved to the ipInfo property of the session. Must return JSON.

  • ipFields: an array of strings indicating the field names of the IP lookup response to store.

Set the ipLookup setting to a falsey value (e.g. empty string) to disable IP lookup completely.