Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Next »

CDP4S supports relating a Sitecore CDP Guest to a Lead or Contact out of the box. Simply set the Master Lookup Field setting to use the ‘Lead__c’ or ‘Contact__c’ field on the Sitecore_CDP_Guest__c object.

Other standard or custom objects can also be configured as below.

Lookup field

Add a custom field to the Sitecore_CDP_Guest__c object. This should be a Lookup reference to the object type desired, e.g. Opportunity.

Set the Master Lookup Field setting to the API name of this field, e.g. ‘Opportunity__c’.

Trigger

To handle analytics deletion and personalization updates, create a custom trigger on your selected object type. For example:

/**
 * Perform required Personalization and Analytics from associated Opportunity changes.
 */
trigger CDP4SOpportunityTrigger on Opportunity (before delete, after insert, after update) {
  if (trigger.isDelete) {
    // Delete related Guest data if settings allow.
    FuseIT_CDP4S_GuestHelper.DeleteGuestsIfCascadeEnabled(Trigger.oldMap.keySet());
  }
  else {
    // Update Sitecore CDP with mapped data when it changes on an Opportunity.
    FuseIT_CDP4S_PersonalizationHelper.UpdatePersonalizationFromTrigger(trigger.new, Trigger.oldMap);
  }
}
  • No labels