Tableau is a powerful tool that helps organizations analyze and visualize their data.

In this article, we will talk about analyzing your HubSpot data with Tableau and the 2 different methods that can be used for HubSpot Tableau Integration.

The Sales, Marketing, and Customer data are invaluable in terms of analysis. Organizations can depend on the insights obtained from it to make conscious data-driven decisions.

What is HubSpot?

  • HubSpot provides Sales, Marketing, Content Management, and Customer Support Services for software technologies.
  • It houses some amazing tools that can help optimize your content using SEO to rank better in Google search results.

What is Tableau?

  • Tableau is a Business Intelligence platform that helps you analyze your data and visualize it in the form of various charts and graphs.
  • These visualizations help you understand your data better, derive insights, and make business decisions.

Prerequisites

  • A HubSpot developer account.
  • A Tableau account.

Methods to Connect HubSpot Tableau Integration

Were you able to find a solution to this? Learn Methods to Connect HubSpot Tableau Integration?
Get a Free Demo of Hevo’s Platform

Method 1: Manual HubSpot Tableau Integration

Step 1: Install the Client Library

Given below are the different client libraries supported by HubSpot. Install the library from the links given below that you want to use to make API call:

Language Package Link
Node.jshttps://www.npmjs.com/package/@HubSpot/apiclient
PHPhttps://packagist.org/packages/HubSpot/apiclient
Rubyhttps://rubygems.org/gems/HubSpotapiclient
Python https://pypi.org/project/HubSpotapiclient/

Step 2: Get the Authentication Key

  • Log in to your HubSpot developer account. Click the settings icon in the main navigation bar. Now move your mouse to Integrations and click on the API key.
  • If a key hasn’t been generated click Generate an API key option. If there is an active key, click on Show and a window will pop up with the API key. 

Step 3: Identify the Required API

  • Once you install a client library, you need to identify the API call from the HubSpot resource. For fetching different data HubSpot provides different APIs.
  • You can use GET, POST, PUT and DELETE methods for the same.
  • For example, to fetch all lead-specific data using the contacts API, we need to use GET /contacts/v1/lists/all/contacts/all method. Refer official page to view implementation using different clients.

Step 4: Implement the API Call

  • In this article, an API call has been made using a Python client. All the HubSpot API calls return data in JSON format.

Sample Python code:

import requests
import json
import urllib

max_results = 500 
hapikey = 'demo' 
count = 5 
contact_list = []
property_list = []
get_all_contacts_url = "https://api.hubapi.com/contacts/v1/lists/all/contacts/all?"
parameter_dict = {'hapikey': hapikey, 'count': count}
#type your Authentication key in place of hapikey
headers = {}

# Paginate your request using offset
has_more = True
while has_more:
	parameters = urllib.urlencode(parameter_dict)
	get_url = get_all_contacts_url + parameters
	r = requests.get(url= get_url, headers = headers)
	response_dict = json.loads(r.text)
	has_more = response_dict['hasmore']
	contact_list.extend(response_dict['contacts'])
	parameter_dict['vidOffset']= response_dict['vidoffset']
	if len(contact_list) >= max_results: # Exit pagination, based on whatever value you've set your max results variable to. 
		print('maximum number of results exceeded')
		break
print('loop finished')

list_length = len(contact_list) 

print("You've succesfully parsed through {} contact records and added them to a list".format(list_length))

Step 5: Prepare the HubSpot Data

Sample Response Data: Here data is extracted in JSON format.

Example response:
{
  "contacts": [
    {
      "addedAt": 1390574181854,
      "vid": 204727,
      "canonicalvid": 204727,
      "mergedvids": [
        
      ],
      "portalid": 62515,
      "iscontact": true,
      "properties": {
        "firstname": {
          "value": "Bob"
        },
        "lastmodifieddate": {
          "value": "1483461406481"
        },
        "company": {
          "value": ""
        },
        "lastname": {
          "value": "Record"
        }
      },
      "formsubmissions": [
        
      ],
      "identityprofiles": [
        {
          "vid": 204727,
          "savedattimestamp": 1476768116149,
          "deletedchangedtimestamp": 0,
          "identities": [
            {
              "type": "LEAD_GUID",
              "value": "f9d728f1dff149b09caa247dbdf5b8b7",
              "timestamp": 1390574181878
            },
            {
              "type": "EMAIL",
              "value": "mgnewemail@HubSpot.com",
              "timestamp": 1476768116137
            }
          ]
        }
      ],
      "mergeaudits": [
        
      ]
    },
    {
      "addedAt": 1392643921079,
      "vid": 207303,
      "canonicalvid": 207303,
      "mergedvids": [
        
      ],
      "portalid": 62515,
      "iscontact": true,
      "properties": {
        "firstname": {
          "value": "Ff_FirstName_0"
        },
        "lastmodifieddate": {
          "value": "1479148429488"
        },
        "lastname": {
          "value": "Ff_LastName_0"
        }
      },
      "formsubmissions": [
        
      ],
      "identityprofiles": [
        {
          "vid": 207303,
          "savedattimestamp": 1392643921090,
          "deletedchangedtimestamp": 0,
          "identities": [
            {
              "type": "EMAIL",
              "value": "email_0be34aebe5@abctest.com",
              "timestamp": 1392643921079
            },
            {
              "type": "LEAD_GUID",
              "value": "058378c6951343e1a13a43a98d47aa22",
              "timestamp": 1392643921082
            }
          ]
        }
      ],
      "mergeaudits": [
        
      ]
    }
  ],
  "hasmore": true,
  "vidoffset": 207303
}

Since the data fetched by the API is in JSON format the data needs to be formatted before moving it into Tableau. For this, you need to identify the schema of the Database or Data Warehouse and specify the data formats according to the data fetched.

Step 6: Move the Data into Tableau

  • Your data is now ready for analysis. Create a new workbook in Tableau and load data into it using load data from a data source option.
  • Using Tableau, you can analyze this fetched data, and create visualizations and Dashboards.

Method 2: HubSpot Tableau Integration Using Hevo

  • Hevo Activate is fully managed and completely automates the process of not only loading data from your desired source but also enriching the data and transforming it into an analysis-ready form without having to write a single line of code. 
  • It helps transfer data from HubSpot to a destination of your choice for free. Its fault-tolerant architecture ensures that the data is handled in a secure, consistent manner with zero data loss.
  • It provides a consistent & reliable solution to manage data in real-time and always have analysis-ready data at your desired destination. 

Check out what makes Hevo Activate amazing:

  • Real-time Data Transfer
  • Data Transformation
  • Secure
  • Tremendous Connector Availability
  • Simplicity
  • Completely Managed Platform
  • Live Support

Conclusion

  1. This article helped you to learn about HubSpot, Tableau, and different methods that you can to set up a HubSpot Tableau Integration.
  2. Though you can create your HubSpot Tableau Integration it is a long and tedious process and you can easily encounter errors.
Easha Meher
Research Analyst, Hevo Data

Easha is a programming enthusiast with 2+ years of experience. She has worked in automation test script creation, regression testing, and integration projects like Thyrocare Integration. She has a bachelor's degree in Computer Science and loves writing technical articles about data engineering. Her goal is to help people solve everyday problems through her work.

Sync Your Data to HubSpot Seamlessly