## TL;DR

The sync creates a new company each run because it never matches on the company domain (or the domain is missing/dirty). Set the sync to dedupe by domain, normalize domains on the source records, and merge the pile of duplicates it already made. The fix is matching configuration, not sync frequency.

## Error

```text
(No error; the symptom is N identical companies named "Acme" with slightly different domains or no domain.)
```

## Steps

1. Inspect the duplicates: list companies with the same name and compare their domain properties. Expected: you see empty, malformed, or varying domains (acme.com vs www.acme.com).
2. Normalize domains on all companies: lowercase, strip protocol and www, drop trailing slashes. Expected: one canonical domain per real company.
3. In the sync settings, set company matching to domain (not name). Expected: the sync updates the existing company instead of creating.
4. Merge the existing duplicates, keeping the record with the most associations as primary. Expected: one company per real company.
5. Re-run the sync and verify zero new companies are created. Expected: steady state with updates only.

## When to use

- Each sync run adds duplicate company records.
- Company count grows without new customers.
- After connecting a new sync source to HubSpot.

## When not to use

- Contact duplicates (email-based, different fix).
- Duplicates from manual entry (duplicate rules, different fix).

## Tool compatibility

- HubSpot CRM sync integrations and the companies API.
- Domain normalization in the sync mapping.

## Variant phrasings

### sync keeps creating companies

The matching setting is wrong or the domain data is dirty.

### duplicate companies after integration

Same root cause from the integration side.

## Why it happens

HubSpot dedupes companies by domain. If the sync does not send a domain, or sends a dirty one, every sync looks like a brand-new company to HubSpot.

## Edge cases

- Subsidiaries sharing a parent domain need manual handling; domain matching merges what should stay separate.
- Companies with no website genuinely have no domain; match those by name plus manual review.
- Some syncs match on HubSpot's internal id only after the first sync; the first run still needs domain matching.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_lrHKX-6R3dnwwZHTx8RwDw
