# Campaign with conditional segments based on checkbox, how to setup?

**URL:** <https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430>\
**Category:** Product Support\
**Created:** [June 10, 2022, 1:24pm UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430 "2022-06-10T13:24:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![urbanspaceman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/urbanspaceman/32/556_2.png) [@urbanspaceman](https://forum.mautic.org/u/urbanspaceman)\
**Post date:** [June 10, 2022, 1:24pm UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/1 "2022-06-10T13:24:26Z")

</div>

**Your software**  
My Mautic version is: 4.3.1  
My PHP version is:  
My Database type and version is: Mysql

**Your problem**  
My problem is: I have a form with a checkbox group, i want to run a campaign and assign users to a specific segment based on the checkbox checked.

Not a problem if i add the user right after they send the form  
but i need to wait a ‘confirmation email’ with a link to a page to confirm the user subscription.

In this case, form field value are not valid of course.  
What solution can I adopt?

Do I need to create a custom field and save the values of those checkboxes?  
What type of field should I use?

Any other solutions?  
Thanks

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [June 10, 2022, 2:38pm UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/2 "2022-06-10T14:38:24Z")

</div>

In creating that form and the check boxes you would have had to create a custom field for the check boxes right? Option A,B,C or D. Therefore when the form is filled out those values are saved and can be acted on at any stage.

Complete the DOI process and create a segment filter using the check box values but include in the filter they must have a successful DOI. That could be a tag or a segment membership based on your DOI technique. Eg has DOI tag and custom check box field = option A

This route means you are using segment filters to file your contacts into segments based on the check box value and not having to use a campaign to do it, but it will only segment them if they have completed DOI.

---

<div class="post-metadata">

**Author:** ![urbanspaceman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/urbanspaceman/32/556_2.png) [@urbanspaceman](https://forum.mautic.org/u/urbanspaceman)\
**Post date:** [June 10, 2022, 2:45pm UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/3 "2022-06-10T14:45:38Z")

</div>

Someone in Discord point me to use the tags  
but the problem persist.

In your way, what if tomorrow i add another list or contact cancel his subscription from one of the list?

---

<div class="post-metadata">

**Author:** ![urbanspaceman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/urbanspaceman/32/556_2.png) [@urbanspaceman](https://forum.mautic.org/u/urbanspaceman)\
**Post date:** [June 10, 2022, 2:48pm UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/4 "2022-06-10T14:48:15Z")

</div>

i get my leads from a campaign form  
then i add 5 points, put the contact in a segment  
and try to check the value of the checkbox with a conditional  
before to add a proper tag to the contact.

The conditional check fail

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9f0950145f1f13ac51f6a39dc69752f71248e112.png)

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [June 10, 2022, 3:16pm UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/5 "2022-06-10T15:16:12Z")

</div>

I am struggling to understand your questions.

Your orginal post was asking how to do DOI and then segment someone based on a supplied value via a form? I think my suggestion will work fine.

In your next post you ask what if you add another list? Do you mean if you import anew list of contacts? I assume this would be a clean opted in list so import then and tage or assign them to the correct segment.

Yor also ask if someone unsubscribes? If they unsub they will stay tagged or in a segment but they will be marked as unsub so no emails will be sent to them. U can run a filter or a campaign action to remove unsubs from segments if you like.

I am not able to follow your campaign structure due the language. I think you are checking for a tag but the tag check is failing even if it is present?

Are u on a recent mautic version? The campaign would check for the tag immediately when the cron runs. Maybe there has not been enough time for the tag to be applied before the campaign checks? Consider adding a time delay before checking for the tag.

---

<div class="post-metadata">

**Author:** ![urbanspaceman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/urbanspaceman/32/556_2.png) [@urbanspaceman](https://forum.mautic.org/u/urbanspaceman)\
**Post date:** [June 11, 2022, 10:23am UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/6 "2022-06-11T10:23:01Z")

</div>

Yes,  
the steps are

source: campaign form  
step 1: add 5 points ok  
step 1b: add user to a segment ok (privacy consent)  
step 1c: conditional assign the contact to TAGs doesn’t works  
step 1d: check if the selected language in the form is italian or English ok  
step 1e: send a optin email in the proper language ok  
step 2: user click on the confirm button  
step 2b: send a greetings email  
step 2c: look for tags and move contact to a proper segment according to the tag (not working because not work on 1c)  
step 3: remove user from campaign after one hour

my chron

```auto
mautic:messages:send 0 16 * * *
mautic:email:fetch 8,28,48 * * * *
mautic:import 45 * 26 5 3
mautic:campaigns:update 0,15,30,45 * * * *
mautic:campaigns:trigger 5,20,35,50 * * * *
mautic:segment:update 10,25,40,55 * * * *
 

```

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [June 11, 2022, 12:21pm UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/7 "2022-06-11T12:21:13Z")

</div>

Step 1c is looking to see if a particular tag has been assigned? How is that tag assigned to a contact before this campaign checks for that tag?

---

<div class="post-metadata">

**Author:** ![urbanspaceman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/urbanspaceman/32/556_2.png) [@urbanspaceman](https://forum.mautic.org/u/urbanspaceman)\
**Post date:** [June 11, 2022, 2:11pm UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/8 "2022-06-11T14:11:27Z")

</div>

1c take the form data and  
if the checkbox ‘firtsoption’ of the field newsletter Is checked, ‘first option’ tag is added  
and I have 2 or more value that can be checked at the same time  
 ![Screenshot 2022-06-11 at 16.10.31](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cfb71081fbf272510ad346ff222acc043eca4256.png)  
 ![Screenshot 2022-06-11 at 16.10.46](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/ca053d9a0ac7cccd8d6aac45dff8e0c8d073b407.png)

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [June 13, 2022, 7:10am UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/9 "2022-06-13T07:10:05Z")

</div>

So I think what is happening is because you are using the same campaign form to enter the campaign, add the tag and check for the tag, it’s all happening too fast so when the check for the tag is done, the tag has not been applied yet. Add in a delay for before checkin for the tag, or use a stand alone form that pushes into a segment and adds the tag, and then use the segment to start the campaign. U could include the DOI tag check as well before starting the campaign.

But I am still confused as to whether your issue is with assigning tags or checking for tags. Looking at your flow and screen grabs it seems the assigning of tags based on the form field is where your issue is?

Can you share the event history of someone who has been through this process? I suspect something else maybe be removing the tag as it is assigned. Also try checking contact field value rather than form value to see if that helps.

---

<div class="post-metadata">

**Author:** ![urbanspaceman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/urbanspaceman/32/556_2.png) [@urbanspaceman](https://forum.mautic.org/u/urbanspaceman)\
**Post date:** [June 13, 2022, 7:44am UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/10 "2022-06-13T07:44:26Z")

</div>

What i see from the contact logs is that the campaign stops at the conditional check for the tags (the values from the checkboxes), trying to create a stand alone form don’t permit conditional tags (or i’m wrong?) I need to assign tags based on the selected checkbox

```auto
02 reminder per la conferma all'iscrizione della newsletter	Email read	Today, 9:24 am
01 Conferma iscrizione alla newsletter	Email read	Today, 9:24 am
Reminder iscrizione / Iscrizione alla newsletter Soundmit	Campaign action triggered	Yesterday, 5:20 pm
02 reminder per la conferma all'iscrizione della newsletter	Email sent	Yesterday, 5:20 pm
Apertura email in italiano / Iscrizione alla newsletter Soundmit	Campaign action triggered	Yesterday, 5:20 pm
2: Iscrizione alla newsletter Soundmit / 5	Point gained	June 10, 2022 5:20 pm
Aggiungo alla lista pending optin / Iscrizione alla newsletter Soundmit	Campaign action triggered	June 10, 2022 5:20 pm
Accettazione dei termini e delle policy / Iscrizione alla newsletter Soundmit	Campaign action triggered	June 10, 2022 5:20 pm
Add 5 points / Iscrizione alla newsletter Soundmit	Campaign action triggered	June 10, 2022 5:20 pm
temp TAG Soundmit newsletter / Iscrizione alla newsletter Soundmit	Campaign action triggered	June 10, 2022 5:20 pm
temp TAG Soundmit revolution / Iscrizione alla newsletter Soundmit	Campaign action triggered	June 10, 2022 5:20 pm
Contact added to segment, Pending OPT-IN Soundmit	Segment membership change	June 10, 2022 5:20 pm
Contact added to segment, Accettazione dei termini e delle policy	Segment membership change	June 10, 2022 5:20 pm
Honeypot / Iscrizione alla newsletter Soundmit	Campaign action triggered	June 10, 2022 5:20 pm
Lingua Inglese / Iscrizione alla newsletter Soundmit	Campaign action triggered	June 10, 2022 5:20 pm
Lingua Italiana / Iscrizione alla newsletter Soundmit	Campaign action triggered	June 10, 2022 5:20 pm
invia opt-in Italiano / Iscrizione alla newsletter Soundmit	Campaign action triggered	June 10, 2022 5:20 pm
01 Conferma iscrizione alla newsletter	Email sent	June 10, 2022 5:20 pm
Contact added to campaign, Iscrizione alla newsletter Soundmit	Campaign membership change	June 10, 2022 5:05 pm
Soundmit newsletter 2022 Event/Revolution	Form submitted	June 10, 2022 5:05 pm
UTM tags recorded	UTM tags recorded	June 10, 2022 5:05 pm
Contact was identified by Soundmit newsletter 2022 Event/Revolution	Contact identified by source	June 10, 2022 5:05 pm
Contact identified	Contact identified	June 10, 2022 5:05 pm
Contact created	Contact created	June 10, 2022 5:05 pm

```

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [June 13, 2022, 9:59am UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/11 "2022-06-13T09:59:33Z")

</div>

Have adding in a delay to the campaign to give time for the tag to be added? Delay checking for the tags by a few minutes

---

<div class="post-metadata">

**Author:** ![urbanspaceman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/urbanspaceman/32/556_2.png) [@urbanspaceman](https://forum.mautic.org/u/urbanspaceman)\
**Post date:** [June 13, 2022, 10:19am UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/12 "2022-06-13T10:19:39Z")

</div>

i try later today. But, I don’t understand a thing. If the contact sends the FORM, why are the tags not associated immediately when the campaign starts (maybe after 10 minutes)? It should be immediate? Changing segment based on tags, happen only after contact confirm his subscription but In the same campaing but in another time. Tags are immediate

---

<div class="post-metadata">

**Author:** ![urbanspaceman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/urbanspaceman/32/556_2.png) [@urbanspaceman](https://forum.mautic.org/u/urbanspaceman)\
**Post date:** [June 13, 2022, 1:12pm UTC](https://forum.mautic.org/t/campaign-with-conditional-segments-based-on-checkbox-how-to-setup/24430/13 "2022-06-13T13:12:13Z")

</div>

tried to save the checkbox value in contact custom fields… no success…  
need a concrete help… sorry
