Multiple Services
The Send2CRM website client is capable of interacting with multiple different services.
Default Service
A default service is always required. Send2CRM sets this up automatically based on the installation script.
This service uses the alias default
, if you need to refer to it specifically. It also supports the analytics
context to enable visitor identification and updates.
Additional Services
Additional services should be registered with the Send2CRM client via the send2crm.services
manager during load.
window.addEventListener('send2crmLoading', (evt) => {
// Register a secondary Send2CRM service.
send2crm.services.register(svcAlias, hostName, apiKey, <contexts>, <formPath>, <visitorPath>);
});
You may register as many additional services as required. Parameters are as follows:
svcAlias: a unique alias used to reference the service.
hostName: the domain portion of the service host.
apiKey: the shared API key of the service.
contexts (optional): an array of codes that specifies where the service is used.
Defaults to none.
All services are available for use with forms on a case-by-case basis.
Add the
analytics
context, i.e.contexts = ['analytics'];
, to perform identification and send visitor updates to the service.Further Send2CRM add-ons may introduce new contexts, or you may use your own for custom functionality.
formPath (optional): set a custom endpoint for form submissions. Defaults to Salesforce path.
visitorPath (optional): set a custom endpoint for visitor updates. Defaults to Salesforce path.