Contact returns to campaign after was removed by campaign action

Your software

My Mautic version is: 3.3.3
My PHP version is: 7.4.9
My Database type and version is: MySQL, mysqlnd 7.4.9

Your problem

When Contact removed from Campaign by Campaign action, after ‘Rebuild campaigns’ cron job triggered contact returned to campaign.

Assume we have one of the action in the campaign, which remove contact from the this campaign:

After action is triggered, contact removed from campaign successfully. From contact events log:

But, after sometime, contact returned back to the campaign. No one make this manually:

This event time suspiciously matches with time when ‘mautic:campaigns:rebuild’ cron job starts.

Code investigation shows that all leads which has ‘manualy_removed = 0’ flag value will be added back to campaign. At the same time, “Remove action” just set Manually removed flag to true, so all looks fine, maybe bug somewhere deeper.

Please, confirm bug or provide us with right solution of this problem.

Hi,
I have a theory, plz check it:

  1. The source of your campaign is a Segment
  2. Contacts are added because they are a member of a segment
  3. You set the campaign so, that contacs can re-enter the campaign
  4. Once you move them out by a campaign action, they are still member of the segment, so requalify and return into the campaign.

Either change segment membership or prohibit reendering the campaign.

Hi Joeyk,

Your theory proved to be correct, we had enabled the ‘re-entering the campaign’ option for testing purposes and that was causing the misbehaviour.

Thank you for your answer, it has been incredibly useful.

Hey,

I am facing the issue that I created the campaign to send automation emails to the segment. But the campaign showing zero contacts.

Please help me.

  1. Screenshot by Lightshot (Campaign Flows)
  2. Screenshot by Lightshot (segment)

Hi,

My suggestion is to check cron jobs (Cron jobs | Mautic):
→ mautic:campaigns:rebuild (alias mautic:campaigns:update) is responsible for the association of contacts to campaigns.