What is the best way to create a campaign with custom fields and tags data split by segments?

Your software
My Mautic version is: 4.1.2
My PHP version is: PHP Version 7.4.28
My Database type and version is: 10.3.34-MariaDB

Your problem
My problem is:

Hello hello everyone!

We manage a community that runs several events, such as Startup Grind Lisbon, Coworking Thursdays, and others. For each event, we have a tick box “would you like to receive news from 351 community” and for the ones who ticks yes, we want to send this email and add " you are receiving this email as when you signed up for XXXXXX (event they signed up), you asked to receive news from us.

From your experience, what would be the best way to import and structure that campaing on Mautic? (I also want to track from which event they come, and if they join other kind of event from us, to don’t send twice the email)

So you want to give the ability to your contacts to save their interest and get content based on that?
(maybe separate newlsletter?)
Like a preference center where you can choose interest and subscribe / unsubscribe basically?

Joey

Hi Joek!

Thanks very much for your reply!

Yes, it is more or less it!! I would love to do something like this:

  1. Participant join one of our events (creativemornings, startupgrind, Coworking Thursdays, etc)

  2. If it is their first time in any of our events, they receive the welcome newsletter,. That newsletter will state that they receive that email because they have joined that specific event

  3. I want to be able to email them in many ways:

    • By event they joined, so I want to be able to email only people who joined Coworking Thursdays to talk about future editions for instance
    • At the very first, we will ask them only this question: “Would you like to join the Portuguese Startup Community?” but depending of what event / initiative they join, we later will gather more info about them, such as if they are a startup founder, an investor, a student, etc. I also want to be able to email everyone (from all the events), according to this other segmentation. So If we have startup founders accross many events, I would love to email everyone about an investment opportunity as an example.
  4. I also want to lead score people, on how many events they are attending

What do you think it could be the best set up for this?

Hi,
I’ve got a new video on how to create an interest based preference center.
It’s a long step by step tutorial. Enjoy.

Joey

Thanks very much Joey!

Does it work same way if I import a contact instead of feeling a form?

Regards.

You can import these values via CSV or FORM as well.

Cheers my man, you rock !

I will pass on for my team, if they got questions I will let you know ((:

Hi @joeyk !

A quick question:

Let’s say I got a contact with the custom field “events:” and a value “Coworking Thrusdays”.

Once I am importing contacts, let’s say the same contact went to “Startup Grind”. When importing, does it overwrite the previous field or it just add on the top?

Regards

I guess what I really would like to ask is how can I lead score based on events.

I will impoort the contacts over every event we have it, and I would like to keep the track on what events they came, and also add some points for the ones who are attending it, but mautic got no “events” under “channels”, would you suggest any workaround?

Hi, maybe @mzagmajster can answer that.

Hi @fernando_jardim ,

first if you import multiple times the value of multiple select field will get overriden or ignored if the contact exists and you do not give the permission to override.

there are several ways to go about this, I will assume you are after the one the requires the least technical knowledge.

Create fields on contacts:

  • events - multiple select - - contains list of all events and you select only the ones contact has attended
  • firstevent - string value of the event contact has attended first
  • lastevent - string - same as first event only for the last event
  • eventpoints - new points for the event - you specify how much points lead is getting because he/she attended some event

when you are importing contacts for specific event in csv you only specify first and last event and eventpoints and allow field override in import settings.

Once you have that structure and data in the database all you need to do is add extra cronjob that runs query like so: (not tested):

/usr/bin/mysql -e "UPDATE leads SET events = CONCAT(events, '|', lastevent), points = (points + eventpoints), eventpoints = NULL WHERE eventpoints IS NOT NULL;  ";

What the above query is doing, is saying OK add last event the lead has been on to the list of all events user has been on add event points to overall lead score.

Even though we have a cronjobs here I think this is the easiest way to achieve what you are asking.

The more proper way of doing this would be to create a custom plugin with lead pre save event listener that checks these fields and adds points.

The most proper way (which I suspect is an overkill in your situation - although I might be wrong) is to extend Point actions and trigger the custom event action on import.

If you do decide to go with a custom plugin, here is the boilerplate I use: GitHub - mzagmajster/plugin-helloworld: Hello World plugin built on the Integration framework

Using the above you only need to add one event listener to LeadEvents::LEAD_PRE_SAVE event and do what I have done above with SQL query.

When you have the fields as the above I think you can easily use the segments to get:

  • leads with specific first/last event
  • all events the user has attended.
1 Like

Super thanks @mzagmajster !!
I wil test it out and come back to you soon :DDD