A father and daughter riding their bicycles on a bridge in Stockholm, Sweden.

Easy Segmentation & Personalization Using ID Fields in Marketing Cloud

Easy Segmentation & Personalization Using ID Fields in Marketing Cloud

min. reading

A common segmentation need with Marketing Cloud Growth or Advanced Edition and Data Cloud is creating a segment based on a Contact’s Record Type within the CRM. While this is possible by adding the Record Type field to the Contact Data Stream and mapping the field to the individual Data Lake Object (DLO), this is not very user-friendly or intuitive. Record types are stored as IDs, and who wants to build a segment based on a Salesforce ID? No worries, I’ve got a better solution!

So What’s the Problem?

Before we get into the solution, let’s first define the problem we’re addressing.

When working with record types in Salesforce, you’ll see labels displayed. These familiar values, such as “Contact,” are easy to understand. However, behind the scenes, Salesforce stores these values as IDs.

The actual values for these record types are 18-digit IDs that can be found in each record type’s URL.

Record Type LabelField Value
Contact012Hs000001p5dvIAA
Partner012Hs000001p5duIAA


Segments can be created using the field values (18-digit IDs), but this method is just asking for trouble. The IDs are very similar and could be easily confused. It takes a keen eye to spot the differences between the field values when compared side-by-side. Imagine trying to segment or personalize based on these values!

Now that we know the problem, let’s fix it!

Solution Summary

To simplify segmentation and personalization, we will create a formula field on the contact data stream to convert the 18-digit ID into text values. We will then map the formula field to a custom field on the individual DMO and add to the data graph. Lastly, we’ll verify that all data has been successfully updated.

Step 1: Create the Formula Field

Formula fields in Data Cloud are a powerful way to transform data into formats that are easier to understand and utilize. In this case, we’ll create a transformation formula in the contact data stream to generate text values for the record type IDs.

You might be wondering if it’s possible to create a formula field on the contact object in Salesforce and ingest it directly into the data stream. While this sounds like a viable option, it can’t be done due to the fact that formula fields in Salesforce are dynamically calculated and don’t have a corresponding value stored in the database.

Creating the Transformation Formula

  • Navigate to the Contact data stream in Data Cloud.
    • Data Cloud > Data Streams > Contact_Home
  • Select the data stream and then click the “New Formula Field Button”.
  • Enter the requested values and formula text.
    • The formula for this example is below.
      • IF(sourceField[‘RecordTypeId’] ==”012Hs000001p5dvIAA”,”Contact”,IF(sourceField[‘RecordTypeId’]==”012Hs000001p5duIAA”,
        “Partner”,”None”))
      • Remember: Your record type IDs can be found in the URL of the record type page.
  • Test the formula for each Record Type ID.
    • Confirm the formula is returning the correct output for each Record Type ID and save.


Step 2: Map to the Individual DMO

Next, we need to map the new formula field to the unified individual DMO. This mapping creates a direct attribute for each unified individual, allowing us to use the text value in Data Cloud segments. For example, this will allow us to create a segment of all unified individuals where Contract Record Type Name is equal to “Contact”.

Mapping Contact Fields

  1. Select the “Review” button in the Data Mapping section of the contact data stream.
  1. Create a new field in the Individual DMO using the “Add New Field” option.
  2. Map the Contact Record Type Name field from the contact DLO to the custom field created in the individual DMO. Save & Close.

 
Step 3: Edit the Data Graph

Data Graphs are required for personalization and dynamic content in Marketing Cloud Growth and Advanced editions. To effectively personalize your emails, ensure your data graph includes all fields required by marketing (including the new formula field that we created). When updating your data graph, it’s also a good idea to review it to confirm it meets all requirements for sending emails as detailed in the second resource below.

Data Graph Resources

Step 4: Refresh the Data

Adding and mapping the new formula field will not trigger a full refresh of the data stream. You must trigger a Total Replace of the data stream and also run the identity resolution ruleset to fully refresh the data and populate the values of the formula field in the unified individual record.

Replacing Data Stream & Running Identity Resolution Ruleset

  1. Add any existing field from the contact object to the data stream.
    • You can do this by clicking “Add Source Fields” within the data stream settings and selecting any available field. This action forces a complete refresh of the data stream, ensuring all data is updated correctly.
  2. Run the identity resolution ruleset.
    • After the data stream refresh completes, manually run the identity resolution ruleset. This ensures that your unified individual records are also updated with the new information. You can find this in Data Cloud by going to Identity Resolutions > Run Ruleset. 

Step 5: Verify the Data

Once your data stream has refreshed and the identity resolution ruleset has run, it’s important to check that your formula field has populated correctly. You can do this by running a Salesforce report using the Unified Individual report type.

Confirm all unified individuals with a value in the “Record Type ID” field also have a value in the “Contract Record Type Name” field by comparing the number of records with values in each field. If the numbers don’t match,  some of your data may not have been updated yet.

Keep in mind that data streams and identity resolution rulesets run on schedules. You might occasionally see differences in the numbers due to these refresh cycles. If you encounter a mismatch, wait for the next refresh cycle and check the report again.

Segmentation Simplified

While both segments below produce the same result, there’s a clear winner in terms of usability. Enabling users to create segments using easily understood, text-based values will improve accuracy and speed of creation. Additionally, these same text values can be used to enhance personalization through merge fields and dynamic content.

Personalization & Dynamic Content

Since our newly created Contact Record Type Name field is related to the individual object, it can be used as a merge field and dynamic content.

Merge Field

Adding the “Contact Record Type Name” field as a merge field in your email will dynamically insert the contact’s record type (Customer or Partner) into the email copy. To prevent blank spaces if a contact doesn’t have a record type assigned, fallback text can be defined. This ensures a smooth and personalized experience for all recipients, even if some data is missing.

Dynamic Content

This is a great way to vary content within an email. For example, a single newsletter could be sent to customers and partners, but display different information based on the Contact Record Type Name field. Customers might see upcoming events, while partners receive a list of partner training resources.


Summary

Segmentation and personalization based on ID fields doesn’t need to be complicated. By investing time upfront in creating and mapping formula fields, marketers can significantly enhance their efficiency and accuracy. This solution minimizes the risk of errors, saves time on backend processes, and enables marketers to confidently create targeted segments and deliver personalized communications.

Big thanks to my friend and colleague Adam Babcock for his collaboration in developing this solution.

Subscribe to The Spot

This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form
This field is for validation purposes and should be left unchanged.

Upcoming Salesforce Events

Salesforce Training Courses

Categories

Top 5 Recent Posts

  • Mike Morris is a 9x Salesforce-certified consultant who joined Sercante in 2019. He has over 20 years marketing experience from previous roles leading internal marketing departments and collaborating with large sales organizations. His strong interest in marketing operations and technology led him to the Salesforce platform and to his current role at Sercante. When not working, he enjoys staying active by running, biking, and getting outside as much as possible.

Leave Your Comment

Related Articles

Bot Single Post