Recording Highlights

Send2CRM Highlights are a means of permanently storing important events for visitors.

Populating Highlights

Highlights can be added to Visitors in a number of ways.

  • Goals and Segments applied via Automation are automatically added as Highlights.

  • Automation can also be used to add Session events sent from the website client according to specific criteria.

  • Highlights can be added from Salesforce.

Via Apex

Send2CRM provides a global helper method to create Highlights:

// Optional. Data to be stored with the highlight in JSON form. Pass null to omit. Map<String, Object> eventData = new Map<String, Object> { 'myproperty' => 10 }; // The Id of the send2crm__s2cVisitor__c record, or any related/identified record such as a Lead or Contact. Id recordId = myLead.Id; // The type of event. May be any short string identifier. String eventType = 'CUSTOMEVENT'; // Have Send2CRM helper record the highlight. Note the Visitor Stat count will also be updated. send2crm.VisitorHelper.recordEvent(eventType, recordId, eventData);

Via Flows

Use the Record Visitor Highlight action to record highlight events in Flows.

There are three parameters to this action:

  • Event Type (required): text to identify the type of event.

  • Record Id (required): Id of either the Visitor or related record (e.g. Lead, Contact).

  • Event Data (optional): collection of Apex-defined GenericFlowData objects. Define key-value pairs for any additional data that should be saved with the highlight.

See the Highlight Emails sent from Salesforce sample implementation for an example.

Via sObject

You can always create a send2crm__s2cSessionHighlight__c record directly. Set fields as follows:

  • send2crm__Event_Type__c: the event type code, e.g. ‘CUSTOMEVENT’

  • send2crm__Event_Time__c: Date/time the highlight should appear against the visitor. Usually the current time.

  • send2crm__Visitor__c: Id of the related send2crm__s2cVisitor__c record.

  • send2crm__Session__c: Id of the related send2crm__Session__c record, if one applies (optional).

  • send2crm__Event_Details__c: human-friendly text containing event information.

  • send2crm__Raw_Event_Data__c: JSON-encoded raw event data. Would normally follow the same structure as the web client, including type and time values.

Â