Skip to main content
All CollectionsForms & IntegrationsCRM - HubSpotPersonalization
Using HubSpot as a data source to create personalized Docs
Using HubSpot as a data source to create personalized Docs

Learn how to use HubSpot contact data to personalize Turtl Docs.

Maruša Barle avatar
Written by Maruša Barle
Updated yesterday

Notes:

  • This feature is available if you have purchased the Personalization module and are on a Professional or Unlimited plan.

  • The following solution requires automation permission in HubSpot, which is available in Hubspot’s Marketing Hub Professional or Enterprise plan.

  • Personalized content can only be created for Contacts in Hubspot, not Companies or any other object type.

You can use the data within your Hubspot CRM to automatically create personalized Turtl Docs when contacts take a certain action - we call this using Hubspot as a data source. Once a personalized Doc has been created in Turtl, we can pass the Doc information back to Hubspot so it can be used in various processes or campaigns. This article will walk you through how to achieve this.

Within this example, we’ll follow the scenario where a visitor submits a form on your website. When that action happens, we want to automatically create a personalized Doc with the visitor’s name on the front cover and email it out to them via a Hubspot email. Your use case might be slightly different, but this should give you an idea of what’s possible and how to achieve it.

1. Account prerequisites

This process requires you to have a working integration between Hubspot and Turtl. When logged into your account, go to "Manage Integrations" to see if you have a working Hubspot integration setup. If you don’t already have this enabled or you’re not sure if it’s enabled correctly, please contact support@turtl.co to get this set up.


2. Prepare your master Doc for personalization

Before you can create personalized content, you need to have a completed Turtl Doc which is set up for personalization and includes a personalization form. We call this a master Doc. If you’re new to this process, see our guide on how to set up a Doc for personalization.

In this example, we have a simple personalization form that has three form fields for the contacts:

  • First name

  • Last name

  • Company name

These form fields will be mapped to three Hubspot properties so the data can be automatically pulled in to personalize the Doc.

  1. Navigate to the personalization form of the Doc you’d like to set up for automatic personalization.

  2. On your first form field, configure the "Prefill Value" so that it is mapped to the Hubspot property you’d like to use data from to personalize your Doc. To do this:

    1. Select the lightning icon next to the Prefill Value field

    2. Select Hubspot as the data source

    3. Choose the Hubspot property to map to your form field

    4. Test that this has worked by adding in a contact ID from Hubspot

    5. Select OK to save changes

      Mapping a Turtl form field with a Hubspot property

  3. Repeat this process for your remaining form fields. Once all form fields are mapped to an appropriate Hubspot property, publish your Doc.

  4. Within the Share options of your Doc, select the API tab and note the Automation URL (you’ll need this later on when creating your Hubspot workflow). Things to note:

    1. Each Turtl Doc you create has a unique automation URL

    2. You can access this URL again at any time by going to the Share options.


3. Prepare Hubspot for data import

Once a personalized Doc has been created in Turtl, the API passes several bits of information back to Hubspot including:

Property

Purpose

Master Doc information

Document ID

The ID of the master Doc

Document Title

The Title of the master Doc e.g. Turtl Overview for %FirstName%

Personalized Doc information

Document URL

The unique URL of the personalized Doc

Personalization ID

The unique ID of the personalized Doc

Personalized Title

The title of the personalized Doc e.g. “Turtl Overview for John”

Personalized Cover Image URL

A link to the cover page image in a .jpg format

Personalized Cover Teaser URL

A link to the cover page image in an animated .gif format

Personalized Facebook Image URL

A link to the cover page image in a .jpg format with optimized dimensions for a Facebook post

Personalized X-post Image URL

A link to the cover page image in a .jpg format with optimized dimensions for an X post

Personalization Tag

You have the option to add a "tag" to your automation webhook URL to help you track and report on groups of personalized Docs within Hubspot e.g. you could group those which are part of the same campaign.

For example, in the automation URL "https://company.turtl.co/webhook/63207XXX11a872d42a53/summercampaign", "/summercampaign" is the Personalization Tag. You can manually add this tag when setting up your Hubspot workflow later on.

  1. In order to use the data for campaigns (such as emailing a contact a personalized Doc), this information needs to be copied onto the Hubspot contact record using a workflow. To prepare for this, we need to create new contact properties in Hubspot.

  2. To achieve our example use case, we’re going to use the Document URL and the Personalized Cover Teaser URL (which links to the GIF of the cover page), so we’ll need two new contact properties in Hubspot to hold this information.

  3. ​Create new contact properties in Hubspot:

    • A single-line text field to hold the Personalization URL.

    • For this example, we’ll name the field "Turtl Overview Personalization URL".

    • A single-line text field to hold the Teaser image (GIF) URL.

      • For this example, we’ll name the field "Turtl Overview Teaser GIF URL.

Note: You will need to create new fields for each personalized email campaign you run from Hubspot in the future. We’ll cover this more later on when we set up our Hubspot workflow.

4. Your contact properties are now ready for use in your email template and workflows.


4. Prepare Hubspot email template

In our example scenario, we’d like to send a contact an email containing a personalized Turtl Doc once they’ve submitted a form on our website. To achieve this, we’ll need to create an email template in Hubspot that can be used as part of the workflow.

For this example, we’ll have two points of personalization within the email template:

  1. A hyperlink in the body of the email text that links off to the personalized Doc

  2. An image of the personalized GIF cover page which will be hyperlinked to the personalized Doc.

Start by creating an "Automated" email within Hubspot. This will enable you to use the email in a workflow later on in this process.

Add a personalized Doc URL

1. Start designing your email and identify where you’d like to hyperlink to your personalized Doc. In our example template, we’ll link the text "personalized overview Doc" to the personalized Doc URL.

2. Copy the token below into the URL to link to each contact’s personalized Doc.

{{ contact.turtl_overview_personalization_url }}

The "turtl_overview_personalization_url" text should be replaced with the internal name of the field you created for the Personalization URL. You can get the internal name from the property settings in Hubspot.

How to get the internal name of a field

3. If you also want to track Known Readers within Turtl’s analytics dashboard, add the following to your Personalization URL: ​

&lead[store]=hubspot&lead[id]={{ contact.hs_object_id }}

We refer to this method of tracking as a Lead Capture URL.

The final URL would then look like this:

{{ contact.turtl_overview_personalization_url }}&lead[store]=hubspot&lead[id]={{ contact.hs_object_id }}

Adding a personalized cover GIF

Within Hubspot’s email builder, select the "HTML - Email" module and place it within your email. We’ll use the HTML module to pull in the personalized Doc’s cover page in a GIF format and hyperlink the GIF to the Personalized Doc URL.

Add the following HTML to the "Edit HTML" section of the module.

The "turtl_overview_personalization_URL" and "turtl_overview_teaser_gif_url" text should be replaced with the internal name of the fields you created for the Personalization URL and Teaser GIF. You can get the internal name from the property settings in Hubspot (as covered in this step).

<a href="{{ contact.turtl_overview_personalization_url }}&lead[store]=hubspot&lead[id]={{ contact.hs_object_id }}"><img src="{{ contact.turtl_overview_teaser_gif_url }}" style="width: 100%; height: auto;"/>
</a>

The href attribute of the anchor (<a>) tag will link the Teaser GIF to the URL of each personalized Doc. If you don’t want to track known readers in Turtl’s analytics dashboard when a reader clicks on the GIF image, remove the lead capture segment of the snippet.

&lead[store]=hubspot&lead[id]={{ contact.hs_object_id }}

The src attribute of the image (<img>) tag will pull in the Cover PNG or GIF depending on which field you reference. In this case, we’ve referenced the Teaser GIF.

The style attribute ensures that the GIF sits neatly within the email boundary.

3. Once your HTML is added, you can return to your email design.

4. Finalize your email design as you normally would. Make sure to save and publish the email template for automation, otherwise it will not be available in the workflow.


5. Create a HubSpot workflow to automate

Now you’ve set up new contact properties and prepared your email, it’s time to bring it all together using a Hubspot workflow. In our example, the workflow will:

  1. Enroll any contacts who submit a specific form on our website.

  2. Send a trigger to Turtl to create a personalized Doc (created in step 2).

  3. Copy the Doc info over to the new fields on the contact record (created in step 3).

  4. Send the personalized Doc to the contact using the new email template (created in step.

  5. Create a workflow: In Hubspot, navigate to Workflows and create a new Contact Workflow

  6. Set enrollment triggers: Set up your enrollment triggers for the workflow. In this example, we want to create a personalized Doc in Turtl when a contact fills in a form.

  7. Add a "Personalize Turtl Doc" action: This action will send a trigger to Turtl to create a personalized Doc.

    • Select from the "Connected apps" section and choose the "Personalized Turtl doc for contact v1.2" action under the Turtl app. (Make sure to select the v1.2 version from the list).

    • Add the Automation URL from your Turtl Doc (as covered in this step) and save. Adding the automation URL lets Hubspot know which Turtl Doc to personalize as part of the workflow.

8. Add a "Copy property value" action: Once the personalized Doc has been created in Turtl, this action will copy the Personalization URL and the Teaser image (GIF) URL over to the contact record so they can be referenced within our email campaign (as covered in this step).

  1. Within the "Copy property value" settings, select the output field and choose which contact property you want to copy the information over to. In our example, we will:

    1. Copy the "Document URL" output to the "Turtl Overview Personalization URL" contact property

    2. Copy the "Personalized Cover Teaser URL" output to the "Turtl Overview Teaser GIF URL" contact property

  2. You will need two "copy property value" actions to configure the two steps above.

Copy the Document URL output over to the Contact record

9 Add a "Send email" action: This will queue up an email to the contact with the personalized Doc.

10. Add the "Send email" step and select the template that we created in this step.


6. Test and launch

Once you’ve completed the steps above, you’re ready to test and launch your workflow. To test everything is working correctly, we recommend that you:

  1. Manually enroll a test contact into the Hubspot workflow and review the output. Ensure that:

    1. A personalized Doc has been created in Turtl and the data from Hubspot has pulled through correctly (e.g. the contact’s name).

    2. The test contact’s record in Hubspot has been populated with Doc info (in this case URL and Teaser GIF URL).

    3. An email has been sent which includes the correct personalized GIF and URL to the Turtl Doc.

  2. Once you feel comfortable that everything is working as expected, you can go ahead and turn your workflow on.

Did this answer your question?