- DarkLight
Note:
Gong provides a native integration with HubSpot which is configured in the HubSpot area of your Company Settings. Go here for more details of how to set this up.
There are 6 steps to creating a HubSpot Integration Zap using webhooks: 1 trigger, 1 date / time action, 3 text actions, and 1 custom request action. In the final step, you will test and save your zap.
Prerequisites
API Key
You need your HubSpot API key, which you can view here. Keep it for later.
Gong-HubSpot integration
Your Gong and HubSpot accounts must be connected, you can connect them here. For more details on connecting HubSpot, see Connect HubSpot to Gong.
Step 1: Set the trigger
For detailed steps on how to create a Zap, see Zapier.
Connect Zapier with your Gong account, the account MUST have Business Admin permissions.
In Set Up Trigger, choose a saved search that you created in Gong in order to filter which calls will be detected by the Zap (an empty box means all calls will be detected).
Note:
The calls must be from the last 30 days.
In Test Trigger, you can see sample calls that fit your saved search. The one you choose will be used to test all following steps in this Zap, so choose one that contains what you need, including the correct HubSpot information.
Click Continue to finish this step.
Step 2: Set the date & time format action
Create a new action and select Format.
Select Date / Time.
We’re going to convert Gong’s time data to a time format readable by HubSpot (Unix Epoch in milliseconds).
In Set up action, under Transform, select Format.
Under Values: Input, click inside the box, and select Started.
It will display the time your sample call started.
Under To Format, click inside the box, choose Custom, and then in the box above Custom, enter XSSS (where X is the timestamp in Unix Epoch, and SSS converts it to milliseconds).
Note: Do not enter this value in the Search box that appears below Custom.
Under From Format, select YYYY-MM-DDTHH:mm:ssZ.
There is no need to set the Timezone fields, unless you want to convert the timezone.
Verify your date and time format is accurate, as shown in the following screenshot, and then click Continue.
Test this step, it should return a number as the output. Copy it to a Unix Epoch converter, such as this one, to make sure the time matches the one your call started at.
Click Close.
Steps 3-5: Set the Text format actions
Convert ; to , in the Contact Crm Ids, Account Crm Ids, and Opportunity Crm Ids fields in order to make them readable by HubSpot.
Create a new action and select Format.
Select Text.
In Set up action, under Transform, select Replace.
Under Values: Input, click inside the box, and select the Contact Crm Ids field from Gong.
Under Find, write ;.
Under Replace, write ,.
Test the action.
Where your call’s field has multiple IDs, the ; between them is converted into ,. For example: A; B is converted into A, B.
Repeat these steps for the Account Crm Ids and Opportunity Crm Ids fields.
Step 6: Set the Custom Request action
Create a new action, select Webhooks by Zapier, select Custom Request, then click Continue.\
Note:
Do not select 'Post' here by mistake!! Patience, young grasshopper. You'll select it in step 2.
Under Method, select Post.
Under URL, paste the following line:
https://api.hubapi.com/engagements/v1/engagements?hapike y=
followed by your HubSpot API key.
For example, if your API Key is “12345”, enter:
https://api.hubapi.com/engagements/v1/engagements?hapikey=12345
Under Data Pass-Through?, select False.
Under Data, paste the following:
{ "engagement": { "active": true, "ownerId": 1, "type": "NOTE", "timestamp": A }, "associations": { "contactIds": [B], "companyIds": [C], "dealIds": [D] }, "metadata": { "body": "A new call was recorded in Gong, here's the link: E" } }
Now replace the following parts of the code with the appropriate fields, according to the fields created when you formatted the Date/Time and Text actions:
A - Replace with the converted Date / Time: Started field.
B - Replace with the converted Text: Contactcrmids field.
C - Replace with the converted Text: Accountcrmids field.
D - Replace with the converted Text: Opportunitycrmids field.
E - Replace with the URL field from Gong. (You can edit the text "A new call was recorded in Gong, here's the link" to whatever you wish).
Note:
Note that B, C, and D are inside [ ] brackets. Do not remove the brackets, only replace the letters with the relevant field.
Under Unflatten, select Yes.
Leave the Basic Auth box empty.
Under Headers, enter Content-type in the first box and application/json in the second.
Check that your action looks similar to the example below (with your own values):
Click Continue to finish this step.
Step 7: Test and save
Test the Custom Request action.
Within HubSpot, go to the activity pages of the appropriate Contacts, Companies, and Deals.
They should all show activity at the time your sample call took place, with the URL and the text you wrote before it.
If there is nothing, retrace your steps, and confirm that your sample call includes the relevant data.
If everything went as expected, congratulations! You can now change the saved search to whatever you want (if needed) and activate the Zap.
Incoming calls will now send data to HubSpot in the same way the test did.