Skip to main content

HubSpot Match Logic

How it works

Phone-number matching logic for 1-to-1 chats

WhatsApp messages are synced to HubSpot Contacts by matching the WhatsApp contact's number with phone numbers saved on HubSpot Contacts. Example: a WhatsApp contact with +447441447478 sends a message, and TimelinesAI has to decide which HubSpot Contact to attach it to. It does this as follows:

  1. If this number was already matched to a Contact recently, the message goes to the same Contact.

  2. Otherwise, TimelinesAI takes the WhatsApp contact's number (always in international format, e.g. +447441447478) and searches for it.

  3. It first searches the standard Contact fields Phone Number, Mobile Phone Number, Fax and WhatsApp Phone Number. The number is found whatever format it's saved in: with or without +, with or without the country code, with spaces, dashes or brackets. For example, +44 7441 447478, 07441 447478 and 447441447478 all match.

    • One Contact found → the message is added to that Contact as a WhatsApp activity.

    • Several Contacts found → the message goes to the most recently created of them.

      Tip: Save phone numbers in HubSpot in international format (+ and the country code). In custom phone fields, avoid unusual groupings such as +44 7441 44 74 78: write the number without spaces (+447441447478), or in the usual +44 7441 447478 / 07441 447478 form. A number you've just added to a custom field can take up to an hour to be picked up.

  4. If nothing is found, it searches other phone-number properties you created in HubSpot yourself, for example a "WhatsApp number" field filled in by Facebook Lead Ads. These fields are found automatically; there is nothing to set up.

    • Up to 5 custom phone fields are searched. If you have more, fields with "WhatsApp" in their name or label come first.

    • One Contact found → the message is added to that Contact as a WhatsApp activity.

    • Several Contacts found → none of them is used, because a custom field may hold someone else's number (an assistant, a switchboard). The chat's sync log lists the Contacts, and TimelinesAI continues as if nothing was found.

  5. Nothing found in standard and custom fields → with Create new Contacts automatically ON, a new Contact is created with the number in Phone Number, and the message is logged there. With it OFF, nothing is synced.

    • New Contact name: the chat's name from TimelinesAI; the first word goes to First name, the rest to Last name. If the chat has no name yet, which is common for a first incoming message, the phone number is used.

    • Renaming: if the chat is later renamed in TimelinesAI or WhatsApp, the Contact's First name in HubSpot is updated too, as long as it still shows a phone number and Create new Contacts automatically is on. A Contact whose name you've already changed in HubSpot is left alone.

    • New Contact owner: chosen in the same order as for new Deals (see below).

Which Deal the message goes to

  • If the Contact has Deals, the message is also logged on the Deal it was last synced to. If there is none yet, the most recently updated Deal is used.

  • Deals that belong to a group chat are skipped, so 1-to-1 messages never land on a group's Deal.

  • With Create new Deals automatically ON, Deals in Closed won or Closed lost are skipped. With it OFF, closed Deals can be used as well.

  • If the Contact has no suitable Deal and Create new Deals automatically is ON, a new Deal is created in the pipeline and stage you selected, and the message is logged there too.

  • New Deal name: Whatsapp deal (chat name). If the chat is later renamed in TimelinesAI or WhatsApp, Deal names are not updated.

Owner of new Contacts and Deals

TimelinesAI chooses the HubSpot owner in this order:

  1. Chat responsible: the person assigned to the chat in TimelinesAI, if their email matches a HubSpot user.

  2. WhatsApp account owner: used when the chat has no responsible, or their email has no match in HubSpot.

  3. Connection owner (fallback): the person who connected HubSpot to TimelinesAI.

Group chats follow different rules: each group is synced to its own Contact (see Group chats sync logic).

Group chats sync logic

Group chats have their own settings, separate from 1-to-1 chats (see HubSpot Integration Settings). A group is synced in one of two ways, depending on Create new Contacts automatically in the group chat settings:

  • On: one HubSpot Contact represents the group and gets the whole conversation (below).

  • Off: nothing is created. The conversation is logged on the existing Contacts of the group's members, and on their Companies (see Group chats on members' Contacts below).

How the group's Contact is found

  1. If the group was synced before, the same Contact is used.

  2. Otherwise, TimelinesAI looks for a Contact whose Phone Number holds the group's unique identifier (JID, ending in @g.us). Because of this, renaming the group doesn't create a new Contact.

  3. Otherwise, it looks for a Contact whose First name is exactly the group's name: the whole name, same spelling and capitalisation. To link a group to an existing Contact, copy the group name from TimelinesAI, paste it into First name, and leave Last name empty.

  4. If nothing is found:

    • With Create new Contacts automatically on in the group chat settings, a Contact is created: the whole group name goes to First name, Last name stays empty.

    • With it off, no group Contact is used: the conversation goes to the members' Contacts instead (see below).

Group chats on members' Contacts

With Create new Contacts automatically off for group chats:

  • The group's daily activity is logged on the existing HubSpot Contacts of the 30 members who wrote most recently, matched by phone number like 1-to-1 chats.

  • The same activity is also added to those members' Companies.

  • Nothing is created: members without a Contact are skipped, and so are your team's own numbers. Deals aren't used.

  • A member who stops writing keeps receiving the group's activity until 30 other members have written after them.

  • Activities logged before you changed the setting stay where they are.

  • Sync log: Activity linked to group member contacts id:…, Activity linked to companies of group members id:…, or No group member matched a HubSpot contact, skip syncing.

When a group is matched or created, its JID is written to the Contact's Phone Number field, replacing any number already there. The JID is also what lets HubSpot Workflows send messages to the group (see How do you send an automated message to a WhatsApp group chat via HubSpot Workflows?).

Important: use a separate Contact for each group. Don't reuse a person's Contact for a group, or their Phone Number will be replaced by the group's identifier.

Important: if your HubSpot account validates phone numbers on the Phone number property, HubSpot rejects the group's identifier and group chats can't sync. See Group chat sync paused: HubSpot phone validation rule.

One Contact per group

If several of your team's WhatsApp numbers are in the same group, the group still gets one Contact and each message is logged once. The group chat on the other numbers shows Messages are already synced from another chat of the same group in its Message sync log.

Owner of a new group Contact

The teammate whose WhatsApp number most recently sent a message in the group, if their email matches a HubSpot user. Otherwise, the person who connected HubSpot. With Update contact and deal owner when group chat assignment changes on, assigning the group chat in TimelinesAI changes the owner to the assignee.

What is logged

  • One WhatsApp activity per group per day, titled WhatsApp Group Chat: {group name} (DD/MM/YYYY). The day follows your HubSpot account's time zone.

  • Each message shows who wrote it: the member's WhatsApp name, or the teammate who sent it.

  • Files are added only when Sync attachments is on. A file that can't be uploaded is named in the activity with the reason (see Messages and files), and the rest of the messages still sync.

  • Calls in group chats are not synced.

Deals

Group chats don't create Deals. A Deal that is already associated with the group's Contact keeps receiving the group's activities; if you remove that association, it stops. If you merge that Deal in HubSpot, the activities follow the merged Deal.

Group chat as seen in TimelinesAI:

The same group chat auto-created as a HubSpot Contact:

Group chat sync paused: HubSpot phone validation rule

If 1-to-1 chats sync to HubSpot but group chats don't, the likely cause is HubSpot's phone number validation rule.

Why this happens

TimelinesAI saves the group's identifier (JID, for example [email protected]) in the Phone Number field of the group's Contact. If the Validate phone numbers, requiring a country code rule is on for the Phone number property, HubSpot rejects it, because it doesn't start with + and a country code. 1-to-1 chats aren't affected: they use real phone numbers.

How to tell

  • When you turn on Create new Contacts automatically for group chats, a window says HubSpot is set to reject WhatsApp group contacts on this portal, and the setting isn't saved.

  • The HubSpot Integration page in TimelinesAI shows a red banner: HubSpot is rejecting WhatsApp group contacts on this portal. Group chat sync is paused, and Create new Contacts automatically for group chats has been turned off.

  • The workspace owner gets an email: HubSpot is rejecting WhatsApp group contacts on your portal — action required.

How to fix it

You need a HubSpot user who can edit contact properties. If that isn't you, forward this section to your HubSpot admin.

  1. In HubSpot, go to Settings → Properties.

  2. In Select an object, choose Contact properties.

  3. Search for phone and open the Phone number property.

  4. Open the Rules tab.

  5. Turn off Validate phone numbers, requiring a country code.

  6. Click Save.

  7. In TimelinesAI, go to HubSpot Integration and turn Create new Contacts automatically for group chats back on. If the window is still open, click Recheck.

The window's Open my HubSpot phone settings link takes you straight to step 3.

Note: only the Phone number property matters. A rule on Mobile phone number doesn't block group chats.

After you fix it

  • Group chats sync again from the next message. The red banner disappears.

  • Messages sent while sync was paused are not added to HubSpot later. They stay in WhatsApp and TimelinesAI.

If you want to keep phone validation on

The rule and group chat sync can't work together on the same HubSpot account. With the rule on, only 1-to-1 chats sync. If you rely on the rule, contact our support team in live chat and include your HubSpot account ID (Hub ID).

Did this answer your question?