Skip to main content
HubSpot tracking code and custom events

Using the HubSpot tracking code to centralize reader engagement data

Maruša Barle avatar
Written by Maruša Barle
Updated over 3 months ago

Notes:

  • You do not need to have a HubSpot integration to send reader engagement events from Turtl to HubSpot.

  • The default HubSpot tracking code is available with all Turtl plans and with all HubSpot subscriptions.

  • Custom events setup in Turtl is available with Unlimited and Professional plans that have the "Custom behavioral events" module added.

  • Please check HubSpot’s Create Custom Events article for information on which Hubspot subscriptions support custom events.

Adding the default HubSpot tracking code to Turtl allows you to track Turtl Doc visits, but you can also send other interesting moments through a custom events setup to support various processes.

How to find the tracking code in HubSpot

To get the tracking code, please follow the HubSpot guide Install the HubSpot tracking code.

  • In your HubSpot account, click the "settings icon" in the top navigation bar.

  • Navigate to "Tracking & Analytics" -> “Tracking code” in the left sidebar menu.

  • In the “Embed code” section, click "Copy".

    copy-tracking-code


What’s the process of getting the tracking code into Turtl

Once you have the tracking code, please send it to support@turtl.co and we will set it up as an extension for you, which can be toggled on/off on your Turtl Docs. You can also choose to apply this extension to all Turtl Docs automatically.


What events does the tracking code collect by default

  • Visited (Turtl Doc) URL


How do these default events appear in HubSpot?

You will get a confirmation when the extension is applied to your tenant from the support team at Turtl. You can then set up a test Doc, flip through it, and then check if the views for that Doc came through to HubSpot. You can see these events in two key places:

1. On the Activity section of a Contact record

Navigate to "CRM" -> "Contacts". Events appear under the "Activities" tab under the Contact record as "Page views".

2. Within reports

Navigate to "Reporting & Data"-> "Reports"-> "Traffic", then click on the "Pages" tab to view page views for specific Turtl Docs.

Note: At the time of writing (April 2024), the traffic page was only available with Marketing Hub Professional and above pricing plans.


How can we customize the tracking code to send custom reader engagement events to HubSpot?

If you are on Turtl’s Unlimited or Professional plan and have purchased the "Custom Behavioural Events" module, our engineering team can customize the standard tracking code to send through additional events (see table below) from Turtl into Hubspot that aren’t captured within the standard tracking code.

We are adding all events by default, but you can select which ones you want to receive on your end by creating them in your HubSpot account.

Notes:

  • Properties in bold can be used for all events.

  • Other properties are event-specific.

  • Words between braces are data types/field types, eg. Page URL (string) → Page URL value is a string.

  • Please contact our support team to share your ideas if you want to track something else.

Custom events list with properties

Event name

Custom properties

Notes

Chapter page turn

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Surf page turn

Page turn

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Immerse page turn

Read Doc 30 seconds

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Read Doc 1 minute

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Read Doc 2 minutes

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Read Doc 3 minutes

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Read Doc 4 minutes

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Read Doc 5 minutes

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Read Doc 8 minutes

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Read Doc 10 minutes

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Enter chapter

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Enter Immerse page(s)

Leave chapter

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Leave immerse page(s)

Logo click

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Contents menu click

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Download the PDF version

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

PDF download button in the Contents menu

Open fullscreen

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Link click

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Label (string)

  • Destination (string)

Lead capture form submission

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Personalization form submission

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

Poll submission

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Question (string)

  • Response (string)

Share button click - Email

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Share button location (string)

Share button location custom property specifies the location where the share button was clicked:

  • Toolbar

  • Immerse level widget

  • Back cover

Share button click - X

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Share button location (string)

Share button location custom property specifies the location where the share button was clicked:

  • Toolbar

  • Immerse level widget

  • Back cover

Share button click - Facebook

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Share button location (string)

Share button location custom property specifies the location where the share button was clicked:

  • Toolbar

  • Immerse level widget

  • Back cover

Share button click - Linkedin

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Share button location (string)

Share button location custom property specifies the location where the share button was clicked:

  • Toolbar

  • Immerse level widget

  • Back cover

Share button click - Xing

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Share button location (string)

Share button location custom property specifies the location where the share button was clicked:

  • Toolbar

  • Immerse level widget

  • Back cover

View chart

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Label (string)

  • Source (string)

  • Open chart in zoom mode

View image

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Label (string)

  • Source (string)

  • Open image in zoom mode

View map

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Label (string)

  • Source (string)

  • Open the map in zoom mode

View PDF

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Label (string)

  • Source (string)

  • Open PDF in zoom mode

Watch video

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Label (string)

  • Source (string)

Listen to audio

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Label (string)

  • Source (string)

View Matterport tour

  • Doc name (string)

  • Doc URL (string)

  • Page URL (string)

  • Workspace (string)

  • Page title (string)

  • Label (string)

  • Source (string)

Creating custom events

For you to see custom events in Hubspot, you need to set up each event within your Hubspot account first.

  • In your HubSpot account, navigate to "Reporting & Data" -> "Custom Events".

  • In the top right, click "Create an event".

  • Select "Code JavaScript".

  • Click "Next".

  • Copy an event name you wish to track from the list above and paste it into the "Event name" field.

  • You can optionally provide your event description.

  • Click "Next".

  • Select "Custom string property".

  • Copy the property from the list of properties associated with your event, e.g. "Doc name", if your event is “Page turn”.​

Page Turn

  • Doc Name (string)

  • Doc Url (string)

  • Page Url (string)

  • Workspace (string)

  • Page Title (string)

  • Optionally, add a description, then click "Done".

  • Repeat for all properties you wish to add listed with your event, then click "Next".

  • Once you've set up your event you'll be presented with a snippet for event tracking. You can ignore this step entirely and click "Done".

  • Repeat the process for any other events you wish to add.


How do these custom events appear in HubSpot?

You will get a confirmation from Turtl when the extension is applied to your tenant. You can then set up a test Doc and trigger the custom events you had set up.

Custom events will appear in Hubspot in the same way that default events do.

In addition, custom events can be seen in the Custom Events Report. To access that, navigate to "Reporting & Data" -> "Custom events", then click the "Analyze tab".

See the HubSpot article Analyze custom events for more information.

Did this answer your question?