# Integration Best Practices

In addition to checking the below, please review the [integration check list](https://docs.locoia.com/best-practice-guides/integration-check-list).

### 1. CRM synchronizations (leads / contacts / companies / accounts)

* Mapping **contacts** - ideally via email, as it is unique
* Mapping **companies** and accounts - ideally via VAT ID or trade registration numbers; alternatively name and country combination, however, this is error-prone
* How to deal with **duplicates** in two systems? Either merge and take one of the two as the leading entity or ignore records and send an email

### 2. Sales Funnel synchronizations&#x20;

Objects: deals / opportunities / orders / invoicing / configure price quote (CPQ)

* **CPQ** - multiple line items per invoice
* Mapping **product ids** ideally based on a common number
* **Currency** - Either use currency symbols or ideally unique three letter-codes (EUR, USD, …)
* **Discounts** - ideally in both systems as a percentage or integer number, being a percentage; mixed spellings need a mapping table (Env Variables)&#x20;
* **Tax rates** - ideally in both systems as a percentage or integer number, being a percentage; mixed spellings need a mapping table (Env Variables)

### 3. Advertising systems

(e.g. Facebook, Google Ads, ... )

* Classical **object hierarchy**: Advertisers > Campaigns > Line Items  > Creatives - Ideally systems have `external_id` fields in order to store your internal IDs there for later reference.
* **Audiences** - Usually IDFA, AAID, cookies, or similar internal identifier

### Considerations for real-time sync vs. daily (scheduled)

* For **real-time** syncs, either webhooks ([Webhook Helper](https://docs.locoia.com/connectors/helpers/webhook-helper) or [Webhook Trigger for Connector](https://docs.locoia.com/connectors/webhook-trigger-for-connectors)) need to be available on both systems, informing the other system that something changed, or a scheduler needs to be run every five minutes and be able to only check for recently updated records, and no one should have worked in the other system in parallel.
* If the before mentioned options are not available, e.g., due to an old system that doesn’t have updated timestamps nor webhooks, a leading system should be determined and ideally, synchronizations should happen less frequently e.g. daily and scheduled (using the [Schedule Helper](https://docs.locoia.com/connectors/helpers/scheduler-helper)), and all data entry and updates should be done in the leading system.
