Import companies and contacts together via CSV, and unique identifier for companies

Hello everyone,

I’m trying to import both companies and contacts into Mautic using a single CSV file. I noticed that, unlike contacts (where “email” is a unique field), there is no option to set a unique identifier for companies—neither for standard nor custom fields.

Additionally, I have found two more issues:

  • It is not possible to import only companies via CSV; the import process seems focused on contacts, and companies can only be linked if imported together with contacts.
  • I have tried importing only companies using a CSV file, but this does not work either—the import either fails or does not create the companies as expected.

These limitations make it very difficult to:

  • Update existing companies via CSV import
  • Avoid duplicates when importing new companies
  • Efficiently link contacts to companies in bulk
  • Import companies without having to include contacts in the CSV

Is there a reason for these limitations?
Are there any plans to support unique fields for companies (like “company code” or “VAT number”) and to allow importing companies alone via CSV in future versions?
Does anyone have a workaround, plugin, or best practice to efficiently manage company and contact imports and updates?

Thanks

Hi @zamlix welcome to the community!

Typically you would import your companies first, and then import your contacts.

Documentation:

Your custom fields dictate what information is available to be matched, so if you’re importing specific information which doesn’t match with Mautic’s available fields, you must create those fields before. This is true for Contacts and Companies. You can also set which fields are unique identifiers, and you could create a company code field, if you wanted. Documentation for custom fields:

When you import the contacts, the name in the primary company field is matched up to the existing ones. This is the unique field, so you’ll need to ensure you’ve only got each company represented once.

Companies are imported via Companies > import, whereas Contacts are imported via Contacts > import - two separate places.

If the company import fails, then it means there’s some issue with your data when you’re importing, perhaps you can share the logs for that, or what the specific error is you’re seeing?

Here’s the info about how duplicates are managed for companies:

Hello zamlix,

You need two csv files, one for companies and one for contacts. The contacts csv needs a company field so Mautic can link them together,

I have successfully imported a significant number of companies into Mautic using the company import feature. And thereafter I have also successfully imported a significant number of contacts that link to the previously imported companies.

The process worked well for me on Mautic 6.0.1 and 6.0.2 which I’ve been running recently.

Thanks.

Hello zamlix,

You also asked about unique fields.

In Mautic you can add custom fields to both the company and contact records for your customisation. I have successfully used custom fields on both the company and contact records

When you are logged into Mautic 6.x, top right click the cog and you will find the custom fields menu at the top.

I have not personally tried importing into custom fields so far myself. However I have used them successfully on contact segment rules. That worked ok for me.

Thanks.

Hi zamlix,

You also asked about about importing companies and contacts using a single csv.

I’m not a mainline Mautic developer however I am a long standing database expert which underpins Mautic.

Csv files have been used for many years to import data into databases. Traditionally one csv is used to import data into one table. This makes the Mautic import feature relatively simple to implement in code.

Therefore importing companies first and contacts second each with their own csv import file is standard database practice. If you have have one csv file use excel to create separate csv for company and contacts. Its a simple task using copy and paste.

The Mautic import feature does handle duplicates and I think you can also add, modify, update and remove records using csv which is great. I’ve used it myself on Mautic 6.x.

Thanks.