Integrations

Connect Odoo

Connect your Odoo instance with a user API key, then map leads, opportunities, contacts, sales orders and paid invoices onto your conversions, and push LeadJourney data back into Odoo.

Connecting Odoo turns record events (new leads and opportunities, stage changes, contacts, sales orders, paid invoices) into LeadJourney conversions, attributed to the campaign, ad set and ad that earned them. Odoo has no OAuth for third-party apps, so you connect with a user API key. Mapped events flow through the same postback pipeline as your offline conversions, so they pick up every ad postback you've already configured. Because LeadJourney re-reads each record from Odoo, you can map any field on it. The connection also works the other way: you can create or update Odoo records from LeadJourney events.

Before you start

Have these ready so the connection works end to end:

  • An active LeadJourney workspace and your Odoo instance URL. Odoo Online and self-hosted instances both work.
  • An Odoo user who can read CRM, Contacts, Sales and Invoicing. The API key inherits that user's permissions. Give the user Settings access too if you want LeadJourney to create the automation rules and the click-id field for you.
  • Tracking is live, so clicks are recorded before records arrive. See Install the tracking script.
  • At least one conversion type to map onto (e.g. WonClient). Set these up first in the Events Manager.

Where to find it

Open Settings → Apps, or go to app.leadjourney.io/settings?slug=apps. Click the Odoo card to open the integration. While you're not connected you'll see a "Connect your Odoo instance" card; once connected, the same screen shows your database, the Odoo setup status, your triggers and the Send to Odoo section.

Step by step

Create an API key in Odoo

In Odoo, click your avatar → PreferencesAccount SecurityNew API Key. Give it a name and copy the key right away: Odoo shows it only once.

Enter your connection details

Fill in the four fields on the Connect your Odoo instance card:

  1. Instance URL: the address you log in at, e.g. https://your-company.odoo.com.
  2. Database: on Odoo Online this is the part before .odoo.com (LeadJourney prefills it from the URL). Self-hosted, it's the database you pick at login.
  3. Login (email): the Odoo user the API key belongs to.
  4. API Key: the key you just created.

Click Connect. LeadJourney validates all four values by authenticating against your instance before saving, and you'll see an "Odoo connected" confirmation. If something is wrong, the error appears right on the form so you can fix it in place.

Check the Odoo setup

Odoo has no webhook LeadJourney can subscribe to, so after connecting LeadJourney creates what it needs inside your Odoo. The Odoo setup panel reports what landed:

  • Automation rules created in Odoo: one rule per record type, each pointed at your account's webhook URL. The models they cover (e.g. crm.lead) are listed underneath.
  • Click-id field created in Odoo: a text field called x_lj_click_id on CRM Lead and Contact.

If either shows a warning, click Re-sync in the header. It recreates the rules and the field, and is safe to press any time because it reconciles rather than duplicating. If the rules stay empty, your Odoo user needs Settings access or the Automation Rules app isn't installed.

Add a trigger

In the Triggers panel ("Each trigger maps an Odoo event to one of your conversions.") click Add trigger. In the New Odoo trigger dialog:

  1. App: Odoo (already selected).
  2. LeadJourney Event: the conversion type this Odoo event should record.
  3. Trigger: pick an Odoo event from the grid (use Search triggers… to narrow it down). Each card shows the Odoo model it needs an automation rule on.
  4. Attribute changed (only on events that support it): fire only when a specific field changes, e.g. the stage. Set a Target value to pin it to one value (fields with fixed options, like pipeline stages or payment status, get a dropdown), or leave it on Any value.

Click Continue.

Receive data and confirm the mapping

The dialog opens a three-tab flow:

  • Receive Data: click Find latest data to load the 3 most recent records for the event. If nothing appears, create one in Odoo and try again, then select a record.
  • Configure Mapping: map the record onto Email, Name, Phone, click_id, Revenue and Currency. Each row can combine several paths (joined with a space) or take a literal with static:value. Use Add custom field for First name, Last name or a new workspace field.
  • Filtering (optional): add conditions and see a PASS or FAIL against the selected record, plus whether "Your trigger would have fired".

Click Save & Continue to finish, or Save and continue later to keep a draft.

How Odoo records link to the right campaign

Put the visitor's click ID into x_lj_click_id on your website form, and conversions attribute to the exact ad click. LeadJourney suggests that field for the click_id row on the Configure Mapping tab automatically. Without a click ID, LeadJourney still matches conversions to leads by email or phone; the field just makes the match exact.

Setting up an automation rule by hand

Prefer to build a rule yourself? Open Set a rule up by hand instead in the setup panel and copy the webhook URL. In Odoo, enable Developer Mode, open Settings → Technical → Automation Rules, create a rule on the model with trigger On create and edit, add the action Send Webhook Notification and paste the URL into its URL field. The fields you tick don't matter, because LeadJourney re-reads the record. The URL contains your account's secret token, so treat it like a password.

Managing your triggers

Each trigger appears as a row (Odoo event → conversion type) with an Active / Paused pill, a summary of mapped fields and filters, and a reminder like Needs an Odoo automation rule on crm.lead.

  • Pause / Resume: use the switch to stop a trigger temporarily without deleting it.
  • Edit: change the event, mapping, filters or target conversion.
  • Delete: type delete to confirm. Other triggers keep running.

Sending data back to Odoo

The Send to Odoo section pushes LeadJourney clicks, conversions and leads into Odoo. Click + Add destination and set:

  1. CREATE THIS ODOO RECORD: Contact (res.partner) or Lead / Opportunity (crm.lead).
  2. WHEN THIS HAPPENS: the LeadJourney event. For conversions you can narrow it with CONVERSION TYPE or keep Any conversion type.
  3. WRITE MODE: Create (always a new record), Update (only update an existing match, skip if none) or Upsert (update the match, or create it).
  4. MATCHING FIELD (Update and Upsert): the Odoo field used to find the existing record. It's added to the mapping automatically.
  5. MAP FIELDS: pick the Odoo field on the left and the LeadJourney values on the right. Click Find latest data to see real example values, or type a fixed value.

Click Create destination. The Sync history table lists every delivery with its status (Success, Failed, Skipped), and failed or skipped ones can be sent again with Retry. Deleting a destination doesn't affect records already in Odoo.

Reconnecting

If the API key is revoked or its user archived, the header flips to Needs reconnect and a banner reads "Odoo rejected the credentials". Create a new key under Preferences → Account Security, click Reconnect and submit the connection form again. If the banner reads "Odoo is unreachable", your instance didn't respond; until it does, incoming events can't be read and no conversions are recorded.

Disconnecting

To remove Odoo, click Disconnect in the header and type disconnect to confirm.

Disconnect deletes your triggers

Disconnecting permanently removes the Odoo connection and deletes every trigger. Odoo events stop flowing into your conversions immediately. You can reconnect later, but your trigger configuration won't be restored. The automation rules in Odoo aren't removed for you: delete them under Settings → Technical → Automation Rules, or leave them, since their deliveries will simply be ignored.

Troubleshooting

No records when you click “Find latest data”?

Nothing matching exists in Odoo yet, or your condition and filters exclude it. Create a matching record, then click Find latest data again. If the dialog shows a message explaining why nothing loaded, follow it.

A trigger never fires?

Check the row's automation-rule hint and make sure that rule exists in Odoo. Click Re-sync to recreate missing rules, and confirm the trigger is Active.

Click-id field shows “Not created”?

Your Odoo user lacks Settings access. Add a text field named x_lj_click_id to CRM Lead and Contact yourself, or reconnect with a user that has Settings access and click Re-sync.

Common questions