6 ways to add contact to segment in mautic

How to add Contact to Segment in Mautic – All ways explained with Example

In this tutorial I am going to describe how we can add a Contact or Contacts to Mautic segment, it is possible to do this in many ways so I am explaining all of them below.

What is Mautic Segment ?

Segment(previously called Lead Lists) is a collection of Mautic Contacts(previously called Leads) grouped together with or without a common property. The whole purpose of the segment is to categorize and create data set out of contacts for various use cases of Mautic.

How to Add Contact to Segment in Mautic ?

There are many ways to do so these are listed below:

  1. Add to segment while importing contact(s).
  2. Select manually from contact list and use Change Segment option.
  3. Use Campaign Action `Modify contact’s segments` to add or change contact segment.
  4. Use Form submission action to add or change contact segment.
  5. Use Dynamic Segment or Segment Filters to add contact to a segment.
  6. Use Point triggers to add to or change contact segment.
  7. Use Mautic API to add or modify contact segment.
  8. Create custom event listeners and change segment programmatically.

Out of all the points mentioned above, I will not demonstrate point number 7 and 8 as this may take a whole post for itself and goes too technical. However if you are interested in Mautic Plugin Development do checkout the tutorial for that.

Import Contacts to Mautic Segment

This method allows you to import a contact to segment while you are importing the list of contacts. As you may know Mautic allows mass import of contacts from csv file. when you upload the file for importing contacts, you may choose a segment where to import. Steps are as follows:

  1. Go to Segments > New.
    1. Fill in the Segment Name.
    2. Save and Close.
  2. Go to Contacts > downward arrow on top right of the screen > import.
  3. Browser the csv file and click Upload.
    1. If needed, please adjust the delimiter and other parameters.
  4. From the dropdown choose the segment where you want to import the contacts.
  5. Finally Choose if you want to import in browser or in background. In my case I choose Import in Browser.
  6. Go to Segments, and you should be able to see the contacts in selected segments.

Add Manually from Contact List – Change Segments

  1. Go to Contacts.
  2. Select the contact you want to add or remove from any segment.
  3. On the top of the list, click on drop down icon to open available options.
  4. Choose Change Segments from available options.
  5. In the Popup you get two options to add and to remove from one or more segments.
  6. Choose the segments in relevant field.
  7. Click save to apply.

Change Contact Segment from Campaign

Mautic campaign is really powerful tool and the backbone of Mautic. It provides a ton of useful actions. Changing contact segment based on some action is one of these. To make the tutorial quick and easy to understand I have used the form based campaign. The steps are as follows:

  1. Create a campaign form (this is for demonstration only, you are free to use Segment as source of campaign trigger).
    1. Create single field of email, this will serve as contact identifier.
    2. Give this form a Name let’s say, “Campaign Trigger Form”.
    3. Save and Close.
  2. Create New Campaign.
    1. Go to Campaigns and click New.
    2. Fill in the Name of Campaign, let’s call it “Segment Change Campaign”.
    3. Launch Campaign Builder.
    4. Choose Campaign Forms as contact source.
    5. Choose “Campaign Trigger Form” as the source form.
    6. Add Action, Modify Contact's Segment.
      1. give some name to this node.
      2. Choose from drop down field, in which segment you want to add contact, or from which segment you want to remove contact.
      3. Click Add.
    7. Click Apply then Close Builder.
    8. Set Published switch to Yes.
    9. Save and Close campaign.
  3. Test action by submitting the form.
    1. Go to Components > Forms.
    2. Click on drop down arrow next to the form created.
    3. Click on Preview from drop down menu.
    4. The form will appear in new tab.
    5. Fill in the email of contact.
    6. Submit the form.
    7. The contact will enroll in the campaign immediately.
    8. When the cron for campaign is executed, the action will execute and will move the contact as per Action node configuration.

Form Submission to modify contact segment

This action is only available for Standalone Form and NOT for Campaign Form. The action is very simple, you need to create a standalone form and from the actions select Modify contact's segment. Complete steps are listed as follows:

  1. Go to Components > Forms.
  2. Create New Form.
    1. From the popup choose, New Standalone Form.
    2. Fill in the Form Name and other details as required.
    3. Create form fields from the Field tab.
      1. For testing purpose I have created only email field.
    4. Finally go to Actions tab to configure form submission action.
      1. From the drop down field under Actions tab, choose Modify contact's segments.
      2. The popup will appear with configuration form.
      3. In the popup select the segments where to add the contact or from which to remove the contact.
    5. Save and Close.
  3. Test the form
    1. Just like in previous section, the testing of form is easy.
    2. Click on the drop down icon in from of form name in the list.
    3. Click on Preview from the drop down menu.
    4. Submit the form.
    5. The action will execute immediately and move contact as per configuration in Action tab.

The video demonstrate this process.

Segment Filters to add contact to a segment

Mautic segment provides a Filter tab, which can be usefull to automatically filter and segregate contacts into different segments. This can be done based on any contact field available within Mautic and even supports the custom field option. To use this feature, follow the steps below:

  1. Create a new segment.
  2. Enter the Segment name.
    1. Let’s call it “Dynamic Segment”
  3. Go to Filters tab.
    1. From the drop down field, choose the contact field you would like to filter upon.
    2. I’ll choose the First name field as I added a pattern to the contacts before importing them.
    3. You will be provided with 2 new fields.
      1. One field is a comparison operator, which allows you to choose from variety of operators like, ‘equals’, ‘not equals’, ‘like’, ‘regex’ etc.
      2. Second field presented is to enter a value to compare against.
    4. So for example I want to filter and segregate all contacts having ‘fn’ in the First name field. So I’ll chose ‘like’ operator to compare against ‘fn’ value.
  4. Save and Close.
  5. When the next pass of mautic:segment:update cron tab is executed it’ll add all the matching contacts in this segment.

The Video demonstrate the process as follows:

Point triggers to modify contact segment

Point Side menu provides two options, One to take action and assign points when contact does something. Second is to take action when points reach a certain limit. We can use the second option in order to trigger the segment change action when contact acquires a certain number of points. For this here’s a demonstration and steps to follow:

  1. Go to Points > Manage Triggers.
  2. Create New Trigger.
    1. Name it whatever you would like to call, I’ll name it “Change Segment Trigger”.
    2. For demonstration purpose I am adding 2 as Minimum number of points.
    3. In the Events tab, choose Modify contact's segments from the Add an event drop down field.
    4. Configure the popup for segments to add or to remove contact from.
    5. Save and Close.
  3. To Test the trigger, you can use any action to increase the points, I am using form previously created.
    1. Go to the standalone form created in previous section of this tutorial.
    2. Edit the form.
    3. Go to Actions Tab.
    4. Remove the action to modify contact’s segments.
    5. Add a new action from drop down field to Adjust contact's points.
    6. Add 1 or 2 points, depending on your trigger value. In my demonstration I use 1 point, so I have to submit the form twice.
    7. Save and Close.
    8. Open the form and submit with an email.
    9. You will notice the point was allocated but segment didn’t change yet.
    10. Submit the form again with same email.
    11. This time you will notice point was allocated and Point Trigger also worked and contact segment was changed as well.

The Video tutorial demonstrate all the steps mentioned above.

As described in the introduction section all the 6 ways have been described above, if you have any queries related to any of these, please do comment below.

Leave a Comment

Your email address will not be published. Required fields are marked *