Skip to content
Digioh HowToDigioh HowTo
  • Get Digioh
  • Pricing
April 7, 2021 by Rishi

How to Integrate Your Preference Center with Segment

How to Integrate Your Preference Center with Segment
April 7, 2021 by Rishi

Preference centers allow email marketers to comply with regulations while reducing unsubscribes and cross-selling other newsletters. By putting subscribers in control of the email communication they receive, you help maintain the good health of your email program.

đź’ˇ If you have already built a preference center and just want to collect data via Segment, you can skip to Part II below.

Otherwise, Digioh’s drag-and-drop preference page builder easily integrates with Segment to sync subscriber preferences in real-time. We’ll show you how to build a preference center with Digioh and integrate your page with Segment to share subscriber data across your marketing stack.

Part I: Create Your Segment Preference Center

To begin creating your preference center in Digioh, choose one of our preference center templates, or choose a blank slate to design your own preference center from scratch.

Next, add your images, opt-in checkboxes, descriptions of your newsletters, a text field that allows subscribers to edit their email address, and any other desired elements for your page. With Digioh, you can drag and drop to place these elements with ease.

For more help, check out the examples & best practices in our preference center guide.

Of course, preference centers don’t have to stop at collecting email preferences. You can also use your page to enrich your Segment data with user interests, job titles, and more. To capture this data with your preference center, add their corresponding fields to your page.

You can also add HTML and CSS using the custom code boxes on the left side of the builder. Use these fields to quickly add your brand’s styles, headers/footers, or other code you need to keep your page on-brand.

Finally, Digioh allows you to create a thank-you page that appears when subscribers submit changes to their preferences. Edit this page by clicking the “Thank You Page” tab on the left side of the page builder.

Part II: Integrate Your Preference Center with Segment Using JavaScript

Segment is a technical tool, so some JavaScript knowledge is required.

The code here assumes that your form structure follows Digioh convention, but you can easily adapt the code to your own forms. It also assumes you’ve embedded the Segment JavaScript tag on your page, either directly or via a tag manager. Embed the code below in a <script> tag on your preference page, or if you’re using Digioh, paste it into the Custom JS for that page.

const urlParams = new URLSearchParams(window.location.search);
const id = urlParams.get("id");  //use the key for the user/email ID in URL
function buildSegmentProperties() {
   const props = {};
   //For each email checkbox option on page, do this
   props[jQuery("label[for=field1']")] = jQuery("#field1").is(':checked');
   //…
   return props;
}
jQuery("#your_submit_button_id").click(function() {
   window.analytics.identify(id, buildSegmentProperties());
});

This JavaScript calls Segment Identify, with the userId associated with the email address, and with traits for each of your email preferences. If you like, you can use the email address itself as the id. 

For Digioh preference centers, your checkboxes will be #field1, #field2, etc, based on their position in the form. If you’re integrating your own preference center, use your own field IDs instead.

đź’ˇ Important: Segment JavaScript is currently blocked by several major Ad Blockers. If this data is mission-critical, then you could miss 5-10% of your data. The only way to avoid Ad Blocker issues is to use the Segment server-to-server API. Digioh preference centers do this out of the box.

Launch Your Segment-Integrated Preference Center with Digioh

Digioh integrates with Segment to help you build a custom preference center and ensure your preference data is available across your marketing stack. To learn more about our preference center builder or other solutions integrated with Segment, reach out to us for a demo.

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to email a link to a friend (Opens in new window) Email
  • More
  • Click to print (Opens in new window) Print
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Reddit (Opens in new window) Reddit
Previous articleHow to Build a Preference Center for Sales Cloud (Salesforce CRM)Next article How to Build Landing Pages Integrated with Segment

About Digioh

Digioh powers personalized forms, pop-ups, surveys, product recommendation quizzes, landing pages, and preference centers for leading brands. With a drag-and-drop builder, 400+ integrations, powerful targeting, and a custom JavaScript editor, Digioh helps you convert site visitors into customers. Visit us to learn more!

Latest Posts

  • How to Build a Product Recommendation Quiz for eCommerce
  • How to Embed a Calendly Scheduler Widget in Your Pop-Ups to Book More Demos
  • How to Build Landing Pages Integrated with Segment
  • How to Integrate Your Preference Center with Segment
  • How to Build a Preference Center for Sales Cloud (Salesforce CRM)

Categories

  • ActiveCampaign
  • AWeber
  • Campaign Monitor
  • Constant Contact
  • Customer.io
  • Digioh
  • E-commerce Personalization
  • ExactTarget
  • GetResponse
  • Google Analytics Salesforce Marketing Cloud
  • iContact
  • Infusionsoft
  • Mad Mimi
  • Magento
  • MailChimp
  • Salesforce
  • Salesforce Commerce Cloud
  • Salesforce Marketing Cloud
  • Segment
  • SendGrid
  • VerticalResponse
  • Weebly
  • Wix
  • WooCommerce
© 2023 Digioh