# Same Segment but different processed time

**URL:** <https://forum.mautic.org/t/same-segment-but-different-processed-time/22567>\
**Category:** Product Support\
**Created:** [February 2, 2022, 12:33am UTC](https://forum.mautic.org/t/same-segment-but-different-processed-time/22567 "2022-02-02T00:33:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidmyeyes](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/davidmyeyes/32/588_2.png) [@davidmyeyes](https://forum.mautic.org/u/davidmyeyes)\
**Post date:** [February 2, 2022, 12:33am UTC](https://forum.mautic.org/t/same-segment-but-different-processed-time/22567/1 "2022-02-02T00:33:32Z")

</div>

**Your software**  
_My PHP version is_ : 7.4.13  
_My MySQL/MariaDB version is_ (delete as applicable): MySQL 5.7

**Your problem**  
_My problem is_ :  
I have two contacts getting added into the same segments at different times, even when they are added through API at the same time? I wonder if anyone has faced a similar issue.

 ![Screen Shot 2022-02-02 at 11.32.30 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cc863aff6ea0ab3ccf26210fe85e288870d527ae.png)  
 ![Screen Shot 2022-02-02 at 11.32.21 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/8/8b551a39fd5dbbcc01a1f7cefe346fb1f5b779b5.png)

_Steps I have tried to fix the problem_ :  
Couldn’t address the cause of this issue.

---

<div class="post-metadata">

**Author:** ![leoschuler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/leoschuler/32/4798_2.png) [@leoschuler](https://forum.mautic.org/u/leoschuler)\
**Post date:** [February 2, 2022, 4:22pm UTC](https://forum.mautic.org/t/same-segment-but-different-processed-time/22567/2 "2022-02-02T16:22:37Z")

</div>

you have to look at very aspect of your configuration (task schedules, campaigns and segments)  
there are different ways a contact can be added or removed from a segment. if a segment have filters, there is a background routine that updates the segment membership that runs on the server every now and then (schedule is configured at each server but I think the default is every 15 minutes, not sure). but if you add the contact manually, the filter will not remove the contact. segments membership can add the contact to a campaign and a campaign have the power to add or remove contacts from segments, and the actions of the campaign also runs as background tasks on the server.  
so you might have a scenario where you add a contact to a segment, the segment triggers a campaign, the campaign changes the segments of the contact.  
also some condition on the segment filter depends on data that is also being calculated during the background tasks, which may delay the inclusion of the contact on a segment.

it is really hard to detect what is causing the issue without knowing your specific scenario and config.  
perhaps a look on the log may show that some routines are being interrupted by an error.

if you already using the api to create a contact, I suggest you use the same api to add the contact to a segment, instead of depend on the segment update task

---

<div class="post-metadata">

**Author:** ![davidmyeyes](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/davidmyeyes/32/588_2.png) [@davidmyeyes](https://forum.mautic.org/u/davidmyeyes)\
**Post date:** [February 3, 2022, 10:20pm UTC](https://forum.mautic.org/t/same-segment-but-different-processed-time/22567/3 "2022-02-03T22:20:22Z")

</div>

Thanks, Leo

Your explanation is really clear and helpful. I will give it a try with your suggestion.
