Loading
Salesforce Personalization
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Display Segment Membership in Merge Fields (Example)

          Display Segment Membership in Merge Fields (Example)

          To deliver Data 360 segment membership IDs on your website, use merge fields. In this example, we show you how to personalize customer experience by displaying Data 360 segment membership information on your website.

          Required Editions

          User Permissions Needed
          To add merge fields to personalization decisions:

          Create and Edit Personalization Points

          Create and Edit Personalization Decisions

          1. Create a Manual Content personalization response template and add Segments as a personalization attribute. See Configure a Personalization Response Template.
          2. Create a Handlebars web experience template for your website connector.

            This enables business users to select the template in the Web Personalization Manager (WPM) and deliver segment membership data directly to the page. See Create an Experience Template.

          3. Create a personalization point using the response template you created in step 1.

            The personalization point acts as the bridge between your data and the web experience.

          4. Add a decision to the personalization point.
          5. Configure a Segment Memberships merge field on the available personalization attribute. See Add a Merge Field.

            To ensure that the necessary data is available to the page at runtime, make sure that the profile data graph used in your personalization point includes the Segments object related to the root DMO. Additionally, within the Data Graph definition, verify that the Segment ID field is selected

          6. Update the sitemap.

            To ensure that the segment memberships returned in a personalization decision response are properly written to both the console and window object, add this snippet to the sitemap or directly to the site.

            /* START: External Segments */
            SalesforceInteractions.Personalization.Config.ContentZoneHandler.set("Export_Segments", {
              onReady: (content) => {
                let segments = []
                try { 
                  segments = JSON.parse(content) 
                } catch(err) {
                  // Handle parsing error
                }
                console.log("segments returned are: ", segments);
                window.sfdcSegments = segments;
              }
            });
            /* END: External Segments */
            
          7. Deploy a new experience to your site using Web Personalization Manager (WPM).
            1. Open Web Personalization Manager on your website and navigate to the target page. See Access Web Personalization Manager.
            2. Create an experience and select Configure Embedded Content.
            3. Select your segment's personalization point and click Next.
            4. In the Location panel, set your target.
              • To target the current page, use Page URL or Page Type.
              • To target every page, use URL Address with a wildcard (for example, https://example.com/*).
            5. In the Display Method section, select Content Zone Handler and select the content zone that you added while configuring the sitemap.
            6. Publish the experience on the site. See Publish a Personalization Experience.
           
          Loading
          Salesforce Help | Article