Prerequisites
- A HubSpot account with Service Hub
- Admin access to HubSpot and to AGO
Step 1: Create a Service Key in HubSpot
- In HubSpot, go to Development, then Keys > Service keys in the left menu
- Click Create service key and give it a name (for example,
AGO Ticketing) - Add these scopes:
- Create the key and copy it
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
- Go to Support > Settings > Forms
- In Active Ticketing System, select hubspot
- Click the wrench icon (Configure ticketing system)
- Fill in:
- Service key: the key from Step 1
- Portal ID: the number from Step 2
- Click Test connection. AGO checks the key and tells you if a ticket or
formsscope is missing. - 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.- Go to Support > Settings > Forms and create a form for HubSpot
- In Custom Fields, click Import a HubSpot form
- Pick a form in the list and click Import
- Review the fields and any messages about what could not be imported, then click Save
- 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.
- 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.
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:- 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.
- 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.
- 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.
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_categorywith 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_categoryproperty 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.
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:
- 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).
- Turns on Sync from HubSpot, and clicks Run now for a first pass.
- 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.
Troubleshooting
Related
- Ticketing: ticketing overview
- Ticket Form Customization: form fields and embedded forms
- Ticketing Connectors: compare the available connectors
