# Hubspot

## Pipeline Concepts

Before setting up the pipeline, learn about pipeline concepts [here](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines)

## Step by Step Guide

### STEP-1: Configure Connection

To learn about Connection, refer [here](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines)

* Log into Sprinkle application
* Navigate to Ingest -> Connections Tab -> New Connection ->&#x20;
* Select Hubspot&#x20;
* Provide all the mandatory details
  * *Name*: Name to identify this connection
  * Connect to Hubspot
  * *Advance Settings* : Refer [here](#advanced-connection-settings)
* Test Connection&#x20;
* Create

### STEP-2: Configure Pipeline

To learn about datasource, refer [here](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines)

* Navigate to Ingest -> Pipeline Tab -> Add ->&#x20;
* Select Hubspot
* Provide the name -> Create
* **Connection Tab**:&#x20;
  * From the drop-down, select the name of connection created in STEP-2
  * Update

### STEP-3: Create Dataset

**Datasets Tab**: To learn about Dataset, refer [here](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines). Add Dataset for each report/dataset that you want to integrate, providing following details

* *Table Type (Required)*
  * *Deals, Contacts, Companies, Products, Tickets*
    * *All Properties*
    * *Multi-Select*
      * *Properties List*
  * *Events, Contact\_List, Engagements, Forms, Email\_Campaigns, Email\_Subscription, Email\_Subscription\_Timeline*
  * *Email\_Events, Marketing\_Email\_Statistics*
    * *Start Date*
    * *Batch Size*
  * *Properties*
    * *Properties Object Size*: Select from *CONTACTS, DEALS, COMPANIES, TICKETS, PRODUCTS*
  * *Form\_Submissions*
    * *All Forms*
    * *Multi-Select*
      * *Form List*
  * *Analytics\_Report*
    * *Object Type*: The type of object that you want the analytics data for.for more details [see this](https://legacydocs.hubspot.com/docs/methods/analytics/get-analytics-data-by-object). Choose from *EVENTCOMPLETIONS, FORMS, PAGES, SOCIAL\_ASSISTS*
    * *Time Period*: The time period used to group the data.You must include at least 1 filter when the :time\_period is monthly, weekly, or daily. for more details [see this](https://legacydocs.hubspot.com/docs/methods/analytics/get-analytics-data-by-object). Choose from *TOTAL, DAILY, WEEKLY, MONTHLY, SUMMARIZE\_DAILY, SUMMARIZEWEEKLY, SUMMARIZE\_MONTHLY*
    * Filte&#x72;*:* Filter the returned data to include only the specified breakdown. You must include at least 1 filter when the time\_period is monthly, weekly, or daily. For example, when breaking down by sources and using d1=organic to drill down into organic search traffic, you can get the data for the specific keywords \`hubspot\` and \`marketing\` using f=hubspot\&f=marketing. for more details [see this](https://legacydocs.hubspot.com/docs/methods/analytics/get-analytics-data-by-object)
    * *Start Date*: From given date records will be downloaded. Date format must be YYYY-MM-DD.
    * *Batch Size*: Number of days for which records will be fetched in one run.
* Flatten Level(Required) : Select One Level or Multi Level. In one level, flattening will not be applied on complex type. They will be stored as string. In multi level, flattening will be applied in complex level till they become simple type.
* *Destination Schema* (Required) : Data warehouse schema where the table will be ingested into
* *Destination Table name* (Required) : It is the table name to be created on the warehouse. If not given, sprinkle will create like ds\_\<pipelinename>\_\<tablename>
* *Destination Create Table Clause*: Provide additional clauses to warehouse-create table queries such as clustering, partitioning, and more, useful for optimizing DML statements. [Learn more](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines/databases/features/destination-create-table-clause) on how to use this field.
* Create

### STEP-4: Run and schedule Ingestion

In the **Ingestion Jobs** ta&#x62;**:**

* Trigger the Job, using Run button
* To schedule, enable Auto-Run. Change the frequency if needed

### Advanced Connection Settings

* **API Read Timeout (In seconds) :**  Maximum time of inactivity between two data packets when waiting for the server's response. The default value is 30 seconds.
* **API Connection Timeout (In seconds) :** Time period within which a connection between a client and a server must be established.&#x20;
* **Retry Limit :** Number of retries allowed when an API call fails. For example if an API call fails and retry limit is 5 then it will check 5 times for that API call and if it succeeded then it will stop checkin&#x67;**.**
* **Retry Sleep Time (In milliseconds) :** Given time, after which retry should happen in case an API call fails.
* **Version:** Hubspot library version
* **Max Records :** Maximum number of records to ingest in one run.

## **Dataset Fields**

<details>

<summary>Company</summary>

* id (Primary Key)
* archived
* created\_at
* about\_us
* address
* address2
* annualrevenue
* city
* closedate
* country
* createdate
* days\_to\_close
* description
* domain
* first\_contact\_createdate
* first\_deal\_created\_date
* founded\_year
* hs\_lastmodifieddate
* hs\_lead\_status
* hs\_num\_child\_companies
* hs\_parent\_company\_id
* hubspot\_owner\_assigneddate
* industry
* is\_public
* name
* notes\_last\_contacted
* notes\_last\_updated
* notes\_next\_activity\_date
* num\_associated\_contacts
* num\_associated\_deals
* numberofemployees
* phone
* recent\_deal\_amount
* recent\_deal\_close\_date
* salesforcetotalrevenue
* state
* timezone
* total\_money\_raised
* total\_revenue
* type
* website
* zip
* updated\_at

</details>

<details>

<summary><strong>Contact Form Submissions</strong></summary>

* contact\_id (Primary Key)
* form\_id (Primary Key)
* form\_submitted\_at

</details>

<details>

<summary>Contacts</summary>

* id (Primary Key)
* huspot\_owner\_id
* createdAt
* annualrevenue
* archvied
* city
* closedate
* company
* country
* createdate
* days\_to\_close
* email
* engagements\_last\_meeting\_booked
* fax
* first\_deal\_created\_date
* firstname
* hs\_buying\_role
* hs\_email\_domain
* hs\_lead\_status
* hs\_lifecyclestage\_customer\_date
* hs\_lifecyclestage\_evangelist\_date
* hs\_lifecyclestage\_lead\_date
* hs\_lifecyclestage\_marketingqualifiedlead\_date
* hs\_lifecyclestage\_oppurtunity\_date
* hs\_lifecyclestage\_other\_date
* hs\_lifecyclestage\_salesqualifiedlead\_date
* hs\_lifecyclestage\_subscriber\_date
* hs\_persona
* hs\_sequences\_enrolled\_count
* hubspot\_owner\_assigneddate
* hubspotscore
* industry
* jobtitle
* lastname
* mobilephone
* notes\_last\_contacted
* notes\_last\_updated
* notes\_next\_activity\_date
* num\_associated\_deals
* num\_contacted\_notes
* num\_notes
* numemployess
* updatedAt

</details>

<details>

<summary>Deal Pipeline</summary>

* id (Primary Key)
* archived
* created\_at
* display\_order
* label
* updated\_at

</details>

<details>

<summary>Deal Pipeline stage</summary>

* id (Primary Key)
* deal\_pipeline\_id (Primary Key)
* archived
* created\_at
* display\_order
* label

</details>

<details>

<summary>Deals</summary>

* id (Primary Key)
* archived
* created\_at
* amount
* amount\_in\_home\_currency
* hs\_acv
* hs\_arr
* closedate
* closed\_lost\_reason
* closed\_won\_reason
* createdate
* currency
* days\_to\_close
* description
* dealname
* hubspot\_owner\_id
* dealstage
* status
* dealtype
* forecast\_amount
* deal\_originator
* hubspot\_team\_id
* updatedAt
* monthly\_revenue
* expected\_volume
* pipeline
* mrr

</details>

<details>

<summary>Engagement</summary>

* id (Primary Key)
* active
* created\_at
* created\_by
* last\_updated
* modified\_by
* owner\_id
* portal\_id
* source
* source\_id
* timestamp
* type
* uid

</details>

<details>

<summary>Engagement Call</summary>

* engagement\_id (Foreign Key)
* callee\_object\_id
* callee\_object\_type
* calls\_service\_call\_id
* diposition
* duration\_milliseconds
* external\_account\_id
* external\_id
* from\_number
* recording\_urlsource
* status
* title
* to\_number

</details>

<details>

<summary>Engagement Email</summary>

* engagement\_id (Foreign Key)
* attached\_video\_opened
* attached\_video\_watched
* bcc
* cc
* facsimile\_send\_id
* from\_email
* from\_first\_name
* from\_last\_name
* from\_raw
* html
* logged\_from
* media\_processing\_status
* message\_id
* pending\_inline\_image\_ids
* post\_send\_status
* sender\_email
* sent\_via
* status
* subject
* text
* thread\_id
* to
* tracker\_key
* validation\_skipped

</details>

<details>

<summary>Engagement Forwarded Email</summary>

* engagement\_id (Foreign Key)
* attached\_video\_opened
* attached\_video\_watched
* bcc
* cc
* from\_email
* from\_first\_name
* from\_last\_name
* from\_raw
* html
* logged\_from
* media\_processing\_status
* message\_id
* pending\_inline\_image\_ids
* sender\_email
* subject
* text
* thread\_id
* to
* tracker\_key
* validation\_skipped

</details>

<details>

<summary>Engagement Meeting</summary>

* engagement\_id (Foreign Key)
* end\_time
* external\_url
* pre\_meeting\_prospect
* source
* start\_time
* title

</details>

<details>

<summary>Engagement Note</summary>

* engagement\_id (Foreign Key)
* body

</details>

<details>

<summary>Engagement Task</summary>

* engagement\_id (Foreign Key)
* body
* for\_object\_type
* subject
* status
* subject
* task\_type
* reminders
* send\_default\_reminder
* priority\_is\_all\_day
* completion\_date

</details>

<details>

<summary>Forms</summary>

* guid (Primary Key)
* archived
* createdAt
* formType
* name
* updatedAt

</details>

<details>

<summary>Line Item</summary>

* id (Primary Key)
* hs\_product\_id
* archived
* created\_at
* properties\_\*

</details>

<details>

<summary>Owner</summary>

* id (Primary Key)
* archived
* created\_at
* email
* first\_name
* last\_name
* updated\_at
* user\_id

</details>

<details>

<summary>Product</summary>

* id (Primary Key)
* archived
* created\_at
* properties\_\*

</details>

<details>

<summary>Ticket</summary>

* id (Primary Key)
* closed\_date
* createdate
* first\_agent\_reply\_date
* hubspot\_team\_id
* hs\_lastactivitydate
* hs\_lastcontatcted
* last\_reply\_date
* hs\_lastmodifieddate
* hs\_nextactivitydate
* hs\_num\_times\_contacted
* hubspot\_owner\_assigneddate
* hs\_pipeline
* hs\_ticket\_priority
* source\_type
* content
* hs\_ticket\_id
* subject
* hubspot\_owner\_id
* hs\_pipeline\_stage
* time\_to\_close
* first\_agent\_reply\_date

</details>

<details>

<summary>Ticket Pipeline Stages</summary>

* id (Primary Key)
* pipeline\_id (Primary Key)
* archived
* created\_at
* display\_order
* is\_closed
* label
* ticket\_state
* updated\_at

</details>

<details>

<summary>Ticket Pipelines</summary>

* id (Primary Key)
* created\_at
* label
* display\_order
* archived
* updated\_at

</details>
