Connect using a HubSpot integration Zap and a webhook
  • 3 minute read
  • Contributors

Connect using a HubSpot integration Zap and a webhook


Article summary

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.

  1. Connect Zapier with your Gong account, the account MUST have Business Admin permissions.

  2. 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.

  3. 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.

  4. Click Continue to finish this step.

Step 2: Set the date & time format action

  1. Create a new action and select Format.

  2. Select Date / Time.

    We’re going to convert Gong’s time data to a time format readable by HubSpot (Unix Epoch in milliseconds).

  3. In Set up action, under Transform, select Format.

  4. Under Values: Input, click inside the box, and select Started.

    It will display the time your sample call started.

  5. 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.

  6. 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.

  7. Verify your date and time format is accurate, as shown in the following screenshot, and then click Continue.

  8. 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.

  9. 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.

  1. Create a new action and select Format.

  2. Select Text.

  3. In Set up action, under Transform, select Replace.

  4. Under Values: Input, click inside the box, and select the Contact Crm Ids field from Gong.

  5. Under Find, write ;.

  6. Under Replace, write ,.

  7. 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.

  8. Repeat these steps for the Account Crm Ids and Opportunity Crm Ids fields.

Step 6: Set the Custom Request action

  1. 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.

  2. Under Method, select Post.

  3. 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

  4. Under Data Pass-Through?, select False.

  5. 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"        
        }
    }
  6. 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.

  7. Under Unflatten, select Yes.

  8. Leave the Basic Auth box empty.

  9. Under Headers, enter Content-type in the first box and application/json in the second.

  10. Check that your action looks similar to the example below (with your own values):

  11. Click Continue to finish this step.

Step 7: Test and save

  1. Test the Custom Request action.

  2. 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.

  3. 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.


Was this article helpful?

ESC

Eddy AI, a genAI helper, will scrub our help center to give you an answer that summarizes our content. Ask a question in plain language and let me do the rest.