B2B marketing data has two owners. People sign up, open emails and log in to the shop. Companies place orders, sit in a price group and have a sales rep. Mautic contacts vs companies is the first design decision in a B2B migration, because every import file, integration call, segment and campaign condition depends on it. Here is how we make that decision and how we test it.
How does Mautic model companies?
Mautic has two separate entities: contacts and companies. A company is a record with its own fields, its own score and a list of linked contacts. The company view shows those contacts with their last activity and an engagement chart for the last six months.
The parts that matter for a data model:
- Company fields. Mautic ships a default set (name, address, phone, website, industry and a few more). You add custom fields in the same Custom Fields screen as contact fields, by switching the object from Contact to Company.
- Unique identifier. By default Mautic treats the company name as the identifier. You can choose any other company field instead, for example a customer number from the ERP. In the company settings you decide whether several identifiers combine with AND or OR. Mautic uses these rules to find and merge duplicates during imports and integrations.
- Many companies per contact. A contact can belong to several companies. One of them is the primary company. When you assign companies in the contact profile, Mautic treats the latest one as primary, and you can change it in the contact details.
- Company score. Companies have their own score, separate from contact points. Campaign and form actions can change it.
- The contact’s Company text field. Contacts also carry a plain Company field. Treat it as a label for the primary company. The relationship lives in the link between the two entities.
So the platform gives you a real relational model. The open question is which data goes where.
Why settle the model before the import?
Everything downstream reads the model. The import files, the integration payloads, the segment filters, the campaign conditions and the email content all point at either a contact field or a company field. Change the model later and each of those changes with it.
Our recent migration from Marketo to Mautic for a German B2B distributor shows the scale. In Marketo the business data sat on the person record, and the first Mautic import followed that flat structure. The client’s middleware team then designed their integration around companies. We moved about 64 fields from the contact to a company entity keyed by the 10-digit SAP customer number. About 42,000 old companies that held only a name had to go and come back as proper records built from SAP keys. The Marketo account was closed by then, so we rebuilt them in place, from the data already in the Mautic database. After that we rewrote the campaign condition that read order data, so it would look at companies instead of contact fields.
It worked, and the client’s campaigns kept running. It is still the reason for our rule: we settle the company model in discovery, before the first import file exists. We ask three questions for every field group:
- Does this value describe a person or an organisation?
- Which system owns it?
- Who writes it into Mautic, and how often?
Which fields belong on the person and which on the company?
Decide per field group, not per field. Groups keep the discussion short.
Put it on the contact when:
- the value can differ between two people in the same company (name, email, language, salutation, job role),
- it records consent or channel preferences (double opt-in flag and date, Do Not Contact, newsletter choices),
- it comes from the person’s own behaviour (shop login, last activity, form answers),
- it is personal to one email address (a voucher code sent in a welcome email).
Put it on the company when:
- every person at the organisation should see the same value (customer number, price group, sales office, region),
- the source system stores it per customer account (order dates, customer status, sales potential),
- a salesperson or account manager owns it,
- you would be confused if two colleagues showed different values.
Then name the source of truth and the writer. Each group gets exactly one system that owns it and one process that writes it to Mautic. Two writers on one field means the last write wins, and nobody knows which write that was.
When a group fits both sides, ask how a segment will use it. “Send to everyone whose company bought in the last six months” is a company filter. “Send to everyone who logged in this month” is a contact filter. The segment wording usually settles it.
A worked example: field groups of a B2B distributor
Here is how the field groups of a B2B distributor with an ERP, a CRM and an online shop typically split. The groups follow the field export we audited in our project. The source column shows the pattern, not one client’s exact setup.
| Field group | Examples | Lives on | Source of truth | Written by |
|---|---|---|---|---|
| Identity | email, first name, last name, salutation, language | Contact | CRM | Integration, forms |
| Consent | double opt-in flag and date, Do Not Contact reason | Contact | Mautic | Mautic (forms, confirmation, bounces) |
| Person IDs | person ID from the ERP or CRM | Contact | CRM | Integration |
| Shop access | shop access flag, shop access date, last login | Contact | Shop | Integration |
| Customer identity | customer number, company name, address | Company | ERP | Integration |
| Orders | first order date, last order date | Company | ERP | Integration |
| Classification | business area, business matrix, price group, customer status | Company | ERP | Integration |
| Sales ownership | sales office, region, sales potential, sales rep ID | Company | CRM | Integration |
| Campaign data | voucher code and validity, engagement dates | Contact | Mautic or voucher service | Mautic campaigns |
Two rows deserve a comment.
Order dates sit on the company because the ERP records orders per customer account. Several buyers at one customer share one order history. If you keep order dates on contacts, the colleague who placed the order looks “active” and the one who did not looks “never bought”, even though they work for the same customer.
Shop access stays on the contact because logins are personal, and the activation emails target the person.
How do you plan the import when the source keeps everything on contacts?
Marketo, HubSpot and many CRMs export company data as columns on the person. You need to turn those columns into company records without losing data. We plan it in four steps.
Step 1: deduplicate by the company key
Pick the matching key first. Use a stable ID from the system of record, such as an ERP customer number. Company names make poor keys: “Müller GmbH”, “Mueller GmbH” and “Müller GmbH & Co. KG” may be one customer or three.
Prepare the key carefully:
- store it as text, so leading zeros survive (a 10-digit number like 0001234567 loses three digits as an integer),
- trim spaces and normalise the format before grouping,
- set the field as the company unique identifier in Mautic before the import.
Then group all contact rows by the key. Each group becomes one company.
Step 2: write conflict rules
Inside each group, some fields will disagree. When a dozen contacts of one company hold different values in a field that moves to the company, a plain migration keeps whichever value it writes last. The rest disappear without a trace.
So we decide the rule per field group before the script runs:
- Take it from the source of truth. If the ERP can export the company record itself, use that and ignore the contact copies.
- Take the latest value when the field has a reliable update date.
- Take the most common value for classifications that were copied to contacts by hand.
- Take the earliest or latest date for date fields (earliest first order, latest last order).
- Flag for review when none of the rules fits.
The script writes a conflict report: company key, field, every value found and the value chosen. The client’s marketing team reviews it once. That report also explains later why a company shows a value that one contact used to have.
Contacts without a key need a rule too. Leave them without a company, or link them to a placeholder only if a segment really needs it.
Step 3: import in the right order
The order is fixed:
- Companies first, matched on the customer number.
- Contacts second, matched on email.
- Links third, one row per contact and company, with the primary flag.
Linking last keeps each step simple to verify. After step 1 you count companies against the number of distinct keys. After step 2 you count contacts against the source. After step 3 you check that every contact with a key has a company and that every multi-company contact has exactly one primary company.
Step 4: dry run, then repeat
We run the whole pipeline on a test instance first, with the same scripts we will use on production, and repeat it until the counts match. Our developers use AI coding agents to draft these scripts quickly. The developer decides the mapping and the conflict rules, reviews every script and approves every run.
What should the integration contract say?
In most B2B setups a middleware team feeds Mautic from the ERP and CRM. In our project the client’s own team owned the middleware. We delivered the data model and API documentation, a Postman collection for testing calls and developer support during their mapping.
Give that team a written contract before they write a line of mapping. Our checklist:
- Matching keys. Companies match on the customer number. Contacts match on email. Write down what happens when an email changes.
- Exact field aliases. List every Mautic field alias the integration writes, for contacts and for companies, with type and format.
- Field ownership. Mark each field as written by the integration or by Mautic. The integration never writes consent fields that Mautic owns.
- Partial updates. Send only the fields you mean to change. In the Companies API an empty string clears the field, so a payload with empty values wipes data.
- Clearing a value on purpose. Agree how the integration signals “this value is gone in the ERP”, so clearing is a decision and not an accident.
- Link and unlink. Linking a contact to a company is a separate operation. When a person leaves a company, the integration calls unlink. Deleting the contact is a different event.
- Primary company. Agree which system decides the primary company and how it is set.
- Read-back checks. A payload with an old or misspelled field name returns HTTP 200 and saves nothing. During testing, read the record back after each write and compare it field by field.
- Order of calls. Company upsert, then contact upsert, then link.
- Change control. When a field is renamed or moved between entities, the contract gets a new version and the middleware team gets the new field list before the change goes live.
A green status code only says the request arrived.
How do segments behave with several companies per contact?
Segment filters can use company fields. With several companies per contact, they follow three rules.
Positive filters match on any company. A contact enters the segment if any of its companies meets the condition. “Company region equals North” includes a buyer who works for one northern and one southern customer.
Each filter row is checked on its own. Mautic joins the company table separately for every filter row. Two company conditions in one segment can be met by two different companies of the same contact. “Price group equals A” AND “customer status equals active” can match a contact whose price group A company is inactive while another, active company sits in price group B.
Negative filters do not work directly. “No company has orders” cannot be written as “company first order date is empty”. With any-company logic that filter matches every contact with at least one company without orders, including contacts whose other company orders every week.
The workaround we use:
- Build a positive helper segment, for example “has a company with orders” (company first order date is not empty).
- In the target segment, add the filter “segment membership: not in” that helper segment.
The helper segment does the any-company match correctly. The target segment then excludes everyone in it. Name helper segments clearly, so nobody sends a newsletter to them by mistake.
Explain these rules in training, using the marketing team’s own segments as examples.
How do you test segments with multi-company contacts?
Build a small set of test contacts with known company links and check every segment that uses company fields against an expected result. We use four profiles:
| Test contact | Companies | Purpose |
|---|---|---|
| A | one company that meets all conditions | basic positive match |
| B | two companies, each meeting a different condition | shows whether two rows are met by two companies |
| C | two companies, one meeting the condition and one not | tests negative filters and helper segments |
| D | no company | checks contacts without a customer number |
For each segment, write down which test contacts should be in and which should be out. Then rebuild the segment and compare. Segments update through cron jobs, so wait for the rebuild or trigger it before you read the result.
Run the same check after any change to the company model, the integration mapping or the segment filters. Test contact B catches most surprises. If B lands in a segment it should not, split the segment into a helper segment and a membership filter, or move the logic into a custom condition.
What about dynamic content and campaign conditions?
Dynamic content. Mautic can change parts of an email based on contact data. Filters on company fields in dynamic content need a patch to Mautic core. In our project we applied that patch. If your emails depend on company data, plan the patch, test it on every Mautic update and document it for whoever maintains the instance.
Campaign conditions. The standard field value condition compares a field with a fixed value. When order data moved to companies, our custom campaign condition for the first purchase track had to follow it. The condition checks whether any company linked to the contact has a first and a last order date that are both set and different. One such company is enough. The same any-company logic applies here as in segments, so decide whether “any company” or “primary company” is the rule you want, and write it down.
FAQ
Can a Mautic contact belong to more than one company? Yes. A contact can be linked to several companies, and one of them is the primary company. Segment filters on company fields match when any linked company meets the condition.
What should be the unique identifier for companies? A stable ID from the system of record, such as the ERP customer number. Set that field as the company unique identifier in Mautic and store it as text so leading zeros survive.
Should order data live on the contact or the company? On the company, when the ERP records orders per customer account. People at the same customer then share one order history, and segments based on orders agree with the ERP.
How do I exclude contacts where no company has a value? Build a positive helper segment for contacts that have a company with the value. Then filter the target segment with “segment membership: not in” that helper segment.
Why did the integration return HTTP 200 but the field stayed empty? The payload most likely used an old or misspelled field alias. Mautic accepts the request and saves nothing for unknown fields. Read the record back after each test write.
Planning a Mautic migration with company data?
This is one of the building blocks of our Marketo to Mautic migration for Meesenburg. For the wider picture, see Marketo to Mautic migration: what transfers and what you have to rebuild and How to plan a marketing automation migration.
Send us your field export and a short description of your ERP and CRM. We will tell you which data belongs on the person, which on the company, and how the import and integration should run. Talk to our Mautic team.
Tags
Written by
Mautomic Team
Mautic experts sharing insights on marketing automation, custom development, and open-source technology.