Chart Metadata
Send2CRM stores color and sort order metadata for chart categories to provide a consistent experience across different sessions and users. These are stored in the send2crm__s2cMetadata__c
object.
By default, records are generated for four Send2CRM Events: SEGMENT, GOAL, PAGE, FRAGMENT. The first two have a sort order that makes them appear first, while the other two are sorted last.
Send2CRM automatically generates new metadata records as required, when Session, Goal, Segment and Highlight data is inserted. However if you wish more fine-grained control over colors or to implement custom sort orders, you may modify the metadata records.
Colors and sort order are used in charts in the main Visitor Dashboard and individual Visitor Lightning Web Components.
Metadata Types
This is a grouping key in the send2crm__Type__c
field. There are three fixed types:
EVENT
GOAL
SEGMENT
In addition to the fixed types, there are also types for various fields in the send2crm__s2cSession object; these will match the field names.
Metadata Names
The Name
field is a key that is unique for each type. There are two special Names which are used for the Session field types:
Unknown, or overridden value of custom label “Unknown”. Used for blank values.
Other, or overridden value of custom label “OtherCategory”. Used when minor categories are grouped.
In all other cases the Name is the value of the Event, Goal, Segment, or Session field.
Colors
Color values are stored as six character hexadecimal strings in the send2crm__Color__c
field. Auto-generated colors are selected randomly from a 65-color qualitative palette designed for accessibility. Colors are not repeated within the same type until necessary.
If you choose to override colors, any six character hexadecimal string is acceptable.
Sort Order
Auto-generated metadata will always have a sort order of zero in the SortOrder__c
field. You may override this with any valid numeric value, positive or negative. The sort is always used in ascending order.
Where multiple metadata records have the same sort order, they will be sorted by Name value in ascending order.