Skip to main content
Connect AGO to HubSpot Service Hub so that when a conversation needs a human, the ticket is created in HubSpot.

Prerequisites

  • A HubSpot account with Service Hub
  • Admin access to HubSpot and to AGO

Step 1: Create a Service Key in HubSpot

  1. In HubSpot, go to Development, then Keys > Service keys in the left menu
  2. Click Create service key and give it a name (for example, AGO Ticketing)
  3. Add these scopes:
  1. Create the key and copy it
If you already connected AGO with a HubSpot private app, its access token keeps working. Add the forms scope to it to import forms.

Step 2: Find Your Portal ID

Your portal ID is the number after /contacts/ in HubSpot URLs:

Step 3: Configure HubSpot in AGO

  1. Go to Support > Settings > Forms
  2. In Active Ticketing System, select hubspot
  3. Click the wrench icon (Configure ticketing system)
  4. Fill in:
    • Service key: the key from Step 1
    • Portal ID: the number from Step 2
  5. Click Test connection. AGO checks the key and tells you if a ticket or forms scope is missing.
  6. Save

Step 4: Create a Ticket Form

The fastest way is to import a form you already use in HubSpot, such as your support form.
  1. Go to Support > Settings > Forms and create a form for HubSpot
  2. In Custom Fields, click Import a HubSpot form
  3. Pick a form in the list and click Import
  4. Review the fields and any messages about what could not be imported, then click Save
The import replaces the fields currently in the form and fills in the form name if it was empty. Fields missing from AGO are created right away, even if you don’t save the form. AI pre-fill stays on for fields that were already in the form. The import brings over:
  • The ticket fields of the HubSpot form, in the same order, with their options
  • The labels of the form and of its options. Customers see the form’s labels. When a form label differs from the HubSpot property label, the form builder shows the property label under it, as the field’s internal name.
  • Conditional logic and dependent fields: a field shown only for some answers stays conditional in AGO. When a field depends on another conditional field, it hides as soon as its parent hides, and its answer is not sent.
  • The Subject and Description standard fields when the HubSpot form shows them
  • The contact’s first name and last name fields. Their answers fill in the name of the HubSpot contact.
  • Hidden fields with a value, such as the pipeline or pipeline stage. They become HubSpot properties set on every ticket in the General tab.
Fields that are new to AGO are created with the form’s Required setting. Fields that already exist keep their settings. What is not imported, with a message after the import:
  • Other contact fields, such as the phone number, and company fields. AGO finds or creates the contact from the email of the person who submits the ticket.
  • File upload fields. Users attach files with the attachment button of the AGO form.
  • Conditions AGO cannot evaluate, such as “is not empty”, conditions on a text field, or a rule that combines several fields with “and”. These fields are always shown.
  • Fields shown by several different fields. AGO keeps a single condition, on the first of these fields it can evaluate.
  • Conditions AGO could not load from HubSpot. The message asks you to import the form again; until then, its conditional fields are always shown.
You can also click Import from HubSpot to add all your HubSpot ticket properties as fields, then pick the ones you want.

HubSpot Properties Set on Every Ticket

In the General tab of a HubSpot form, HubSpot properties set on every ticket lists fixed values sent with each ticket from this form. Use it, for example, to send each form to its own pipeline: Use HubSpot internal property names and values, as shown in Settings > Properties in HubSpot. A value the user enters in a form field takes priority over a fixed value for the same property. Note: To show a native HubSpot form in the chat instead, use Embedded Forms.

What AGO Creates in HubSpot

When a user submits a ticket:
  1. AGO looks up the user’s email in HubSpot and creates the contact if it doesn’t exist, with the first and last name entered in the form. For an existing contact, AGO only fills in a name that is empty in HubSpot.
  2. A ticket is created and linked to the contact. It goes to the pipeline and stage set on the form, or to your default pipeline at its first stage.
  3. Attached files are added to the ticket as notes. If HubSpot refuses them, the ticket is still created and the failure appears in Agents > Monitoring > Known problems.
The ticket in AGO links to the ticket in HubSpot.

Field Mapping

Fields added with Import from HubSpot are sent to their HubSpot property. To map a field you created yourself, set its external ID to hubspot_property_<property name>, for example hubspot_property_product_line.

Ticket category

The ticket category is set by the form:
  • A fixed category for the whole form: add hs_ticket_category with the internal value of one of your HubSpot categories to HubSpot properties set on every ticket.
  • A category the user chooses: import a HubSpot form that contains the category field, or add the hs_ticket_category property with Import from HubSpot.
  • From the typology: when the form shows the Typology field, AGO sends the HubSpot default category of the type the user chose: Question → GENERAL_INQUIRY, Task → FEATURE_REQUEST, Incident → PRODUCT_ISSUE. The two options above take priority.
When the form shows none of these, tickets are created without a category. If your HubSpot account no longer has the default category of a typology, AGO creates the ticket without a category and lists the problem in Known Problems.

Owner Assignment

Tickets can be assigned to a HubSpot owner based on the option a user picks in a dropdown field. To set this up, contact AGO support with the field, its options, and the HubSpot owner for each option.

Sync HubSpot records into Customers

With Customers enabled, AGO can also read your HubSpot companies, contacts, deals and custom objects into Customers, and send the changes made in AGO back to HubSpot, using the same service key. Add these scopes to the key for the objects you sync: Then, in the HubSpot section of Business > Settings > General, an administrator:
  1. Adds a mapping for each HubSpot object to sync: which object type receives it (companies, contacts, deals or one of your custom objects), which HubSpot property fills which attribute, and whether changes made in AGO are sent back to HubSpot (Send changes back to HubSpot).
  2. Turns on Sync from HubSpot, and clicks Run now for a first pass.
AGO then syncs every 15 minutes:
  • Companies are matched on their domain, contacts on their email, and other records on the HubSpot object they came from; anything else is created.
  • A HubSpot contact is attached to its company when companies are synced too, and so is a HubSpot deal synced into deals.
  • A deal’s HubSpot stage is matched to the deal stage of the same name in AGO. Give your stages the names of your HubSpot stages, or the deals in other stages are reported as not saved.
  • Mapped attributes follow HubSpot: a value you change in AGO is replaced at the next change in HubSpot. Attributes you do not map are never touched.
  • For a mapping that sends changes back, the mapped attributes changed in AGO since the previous run are first sent to the HubSpot records they came from. Records created in AGO are not created in HubSpot. When the same property changed on both sides between two runs, the AGO value is kept. A deal’s stage is sent as the HubSpot stage of the same name.
  • Without it, nothing is written to HubSpot.
  • The sync writes as the administrator who last saved its settings, with their access. If that person loses their access, the sync stops until someone saves the settings again.
The card shows the last run: records created, updated, sent to HubSpot, and those that could not be saved, with the reason.

Troubleshooting