> For the complete documentation index, see [llms.txt](https://docs.storylane.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.storylane.io/hubs-docs/integrations/integrations/hubspot.md).

# HubSpot

Storylane integrates seamlessly with HubSpot, enabling you to:

* Sync demo data with existing leads.
* Automatically create new leads if they don’t exist.
* Create and update accounts with demo data.
* Log demo session activity on the HubSpot timeline.
* Capture leads directly via HubSpot forms.

{% hint style="warning" %}
You must have **admin** level permissions to connect any integrations within Storylane
{% endhint %}

{% hint style="info" %}
You can also access the Storylane App directly from the HubSpot sidebar. [Read more.](/hubs-docs/integrations/integrations/hubspot/storylane-app-for-hubspot.md)
{% endhint %}

Follow these step-by-step instructions below to set up the integration:

***

### **Step 1: Add the Storylane Code to Your Website (Optional)**

This step enables lead attribution tracking. Add the following code snippet to the `<head>` tag of your website:

```javascript
(function(){"use strict";function e(t){const r=t.head;if(!r)return;const i=t.querySelector('script[src="https://js.storylane.io/js/v2/storylane.js"]'),n=t.querySelector('script[src="https://js.storylane.io/js/v1/storylane.js"]');if(i||n)return;const s=t.createElement("script");s.type="text/javascript",s.async=!0,s.src="https://js.storylane.io/js/v2/storylane.js",r.appendChild(s)}e(window.document)})();
```

> 💡 [Learn more about Lead attribution here](/analytics-and-performance/lead-attribution.md#lead-attribution-tracking).

***

### **Step 2: Connect HubSpot with Storylane**

1. Access the **HubSpot Integration** section in your Storylane dashboard under **Settings > Integrations**.
2. Click the **Connect** button.
3. Next, setup sidebar groups, record heder cards, and create a custom view. Give it a spin below! ↓

{% @storylane/embed subdomain="app" linkValue="94ugt7nyyhes" url="<https://app.storylane.io/share/94ugt7nyyhes>" %}

***

### **Step 3: Integration Settings**

Once your integration is connected, you can configure what information is sent from Storylane to HubSpot. You have two options:

* Contact-level data
* Company-level data

When processing records, the following logic applies:

<mark style="color:$warning;">**Contacts**</mark>

* Contacts are searched and matched by email address.
* If the email already exists, the existing contact record is updated.
* If the email does not exist, a new contact record is created.
* If a contact is already marked as a non-marketing contact in your CRM, this field will not be updated.
* The system will only assign the marketing contact status to contacts that it creates.

<mark style="color:$warning;">**Companies**</mark>

* Companies are searched and matched by domain.
* If the domain already exists, the existing company record is updated.
* If the domain does not exist, a new company record is created.

To adjust these settings, locate the Edit Integration icon next to the *Connected* status.

<div align="left"><figure><img src="/files/OeSG0RIyHO4YidF1ATvj" alt="" width="563"><figcaption></figcaption></figure></div>

***

### 💡 **What Data Does Storylane Sync to HubSpot?**

#### **Custom Properties**

Storylane populates custom fields in HubSpot contacts under the "Storylane" property group. Here's a breakdown:

| **Property Name**                      | **Description**                                     | **Data Type** |
| -------------------------------------- | --------------------------------------------------- | ------------- |
| Storylane Demo Sessions                | **Total** number of demo sessions                   | Integer       |
| Storylane Demo Name                    | Last demo viewed                                    | String        |
| Storylane Demo Viewed At               | Last demo view timestamp                            | DateTime      |
| Storylane Demo Time (secs)             | Time spent on demo (seconds)                        | Number        |
| Storylane Demo Complete (%)            | Percentage of steps completed                       | Number        |
| Storylane Demo Link                    | Link to the demo                                    | String        |
| Storylane Demo CTA Clicked             | CTA URL clicked                                     | String        |
| Storylane Demo Checklist Completed     | Indicates if the checklist is done                  | Boolean       |
| Storylane Demo Session Link            | Link to audience session                            | String        |
| Storylane Buyer Hub Viewed at          | Timestamp of most recent Hub view                   | DateTime      |
| Storylane Buyer Hub Link               | Link to the Hub                                     | String        |
| Storylane Buyer Hub Name               | Name of the Hub viewed                              | String        |
| Storylane Buyer Hub Content Viewed (%) | % of Hub content viewed                             | Number        |
| Storylane Buyer Hub Time (secs)        | Total time spent in the Hub                         | Number        |
| Storylane Buying Intent                | Engagement-based intent level (Low / Medium / High) | String        |

<figure><img src="/files/PRaYF6fsHbEY7AnHZ3lr" alt="" width="375"><figcaption></figcaption></figure>

***

#### **Custom Events**

Each demo session creates a custom timeline activity in HubSpot. This includes multiple demo views and engagement history. Here's a reference below:

<figure><img src="/files/wAoXYLQZnXahYoR6y8RB" alt=""><figcaption></figcaption></figure>

***

By following these steps, you can efficiently connect Storylane and HubSpot, ensuring seamless lead management and data insights for your demos.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.storylane.io/hubs-docs/integrations/integrations/hubspot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
