---
title: "Assigning Opensense tags with a HubSpot workflow"
slug: "create-a-hubspot-workflow"
description: "Build a HubSpot workflow that writes an Opensense tag to contact records, match the tag to a campaign, and check which banner a recipient gets."
updated: 2026-09-21T17:04:06.000Z
canonical: "https://help.opensense.com/docs/create-a-hubspot-workflow"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://help.opensense.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Assigning Opensense tags with a HubSpot workflow

## Overview

Learn how to build a HubSpot workflow that writes an Opensense tag to a contact record, so the right banner shows in that contact's emails. This guide covers HubSpot's current workflow builder, including how to target contacts using properties on the contact record, on associated records such as Company, and on custom objects.

:::note[Before you start]
You need:

- The [Opensense HubSpot integration connected](https://help.opensense.com/docs/hubspot-integration), with the **sgentags** contact property created during setup
- HubSpot permissions to create and publish workflows
- A banner campaign in the Opensense portal, or a plan for the tag value you'll assign: see [configuring campaigns](https://help.opensense.com/docs/creating-banner-campaign) and [tags](https://help.opensense.com/docs/creating-banner-campaign#3-select-tags)
- A test contact record you can send to and check against
:::

This article uses one worked example throughout: showing an accounting-industry webinar banner to every contact who works at a company in the Accounting industry. The tag value is `accounting_industry`.

## Part 1: Build the HubSpot workflow

### Step 1: Start a new workflow

In HubSpot, go to **Automations** > **Workflows**, then select **Create workflow**.

![HubSpot Automation page on the Workflows tab, with the Create workflow button in the upper right](https://help.opensense.com/media/image-1789686633040-0b41f5ed57e8.png)

### Step 2: Choose From scratch

In the **Create workflow** menu, select **From scratch**.

![Create workflow menu open, showing From scratch, From template, With AI, and With new builder](https://help.opensense.com/media/image-1789686612491-ac3b9b884f39.png)

### Step 3: Choose a trigger type

On the **Triggers** panel, select **Met filter criteria**. This enrolls records whenever they match the conditions you set in the next steps.

![Triggers panel with Trigger manually, Met filter criteria, and On a schedule, with Met filter criteria selected](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-95734e8c2975.jpeg)

### Step 4: Choose the record type that can enroll

Select **Contact**. Opensense tags are written to contact records, so contacts must be the enrolling record type, even when your targeting criteria are on another object.

![The Choose a type of record that can enroll list, showing Contact, Company, Deal, Ticket, and other record types](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-06fc82c7b04c.jpeg)

### Step 5: Set your enrollment criteria

Select **Add criteria**. The criteria panel opens with a **Viewing** menu at the top, set to **Contacts (primary)** by default. This menu lets you target on records other than the contact.

Use the **Viewing** menu to choose where your criteria come from:

<dl class="kb-insights-summary">
  <div><dt>Contacts (primary)</dt><dd>Properties on the enrolled contact record itself, such as Job Title or Lifecycle Stage.</dd></div>
  <div><dt>An associated object</dt><dd>Properties on a record the contact is associated with, such as Company or Deal.</dd></div>
  <div><dt>A custom object</dt><dd>Any custom object in your portal, listed under <strong>Custom Objects</strong> at the bottom of the menu.</dd></div>
</dl>

![The Viewing menu open on the criteria panel, showing standard objects and a Custom Objects section](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-2e1e88caf17d.jpeg)

When you've chosen an object, pick a filter type, using the tabs under the menu:

<dl class="kb-insights-summary">
  <div><dt>Properties</dt><dd>Filter on a property value, such as Industry or Country.</dd></div>
  <div><dt>Events</dt><dd>Filter on an activity or event.</dd></div>
  <div><dt>Memberships</dt><dd>Filter on list, workflow, or import membership.</dd></div>
</dl>

![The criteria panel on the Properties tab, with a search field for Contact properties and a grouped property list](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-00ef647a6ebf.jpeg)

To target a list instead of a property, open the **Memberships** tab, choose **Segment (List) membership**, and then select your list.

![The criteria panel on the Memberships tab, showing Segment (List) membership, Workflow enrollment, and Import membership](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-5348191fa90a.jpeg)

### Step 6: Review the criteria group and continue

Your finished criteria appear as a group on the right. In this example, the group reads: **Contact is associated to Any Company where any of the associated companies match: Industry is any of Accounting**.

Select **Next**. The trigger card at the top of the canvas now summarizes your conditions, instead of showing "No enrollment conditions".

![Enrollment criteria showing Contact associated to Any Company where Industry is any of Accounting, with the Next button](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-6201e8cc8375.jpeg)


### Step 7: Set re-enrollment, then save

On the **Settings** step, decide whether contacts can re-enroll after they complete the workflow, then select **Save and continue**.

![The Triggers Settings step, showing the Re-enroll toggle and the Save and continue button](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-9c2008bfb413.jpeg)

Leave re-enrollment off if a contact should be tagged once. Turn it on if contacts may qualify again later: for example, if they move to a company in a different industry, and should get a different banner.

### Step 8: Add the Edit record action

Select the **+** under the trigger card to add an action. In the **Choose an action** panel, search for **edit record**, then select **Edit record** under **CRM**.

![The Choose an action panel, with edit record searched and the CRM Edit record action highlighted](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-c2a09f31335e.jpeg)

### Step 9: Choose the sgentags property

Leave **Record type** set to **Contact (Current object)**. Open the **Property to edit** menu, search for **sgentags**, and select it. The property is labeled **Opensense Ads (Campaign Tag)**.

<div class="kb-media-carousel" data-kb-media-carousel aria-label="Choosing the sgentags property">
  <div class="kb-media-carousel__viewport">
    <figure class="kb-media-frame"><div class="kb-media-frame__visual"><img src="https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-2bad739bfdf9.jpeg" alt="The Edit record panel, with Record type set to Contact (Current object) and the Property to edit menu" width="2648" height="1480" loading="lazy" decoding="async"></div><figcaption><strong>Property to edit</strong> · Record type stays Contact (Current object)</figcaption></figure>
    <figure class="kb-media-frame"><div class="kb-media-frame__visual"><img src="https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-ed4f0c750b81.jpeg" alt="The property menu with sgentags searched, showing the sgentags Opensense Ads (Campaign Tag) result" width="2648" height="1481" loading="lazy" decoding="async"></div><figcaption><strong>sgentags</strong> · Labeled Opensense Ads (Campaign Tag)</figcaption></figure>
  </div>
</div>

:::tip[Static banner instead?]
Use **sgenads** instead of **sgentags** to set a static banner, rather than a tag-matched campaign.
:::

### Step 10: Set the tag value

Set **Change type** to **Replace**, then enter your tag in the **Choose a value** field. In this example, the value is `accounting_industry`. Select **Save**.

![The Edit record panel, with sgentags selected, Change type set to Replace, and accounting_industry entered as the value](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-acbfd4b4c2c2.jpeg)

:::note[Change type replaces the old checkbox]
Earlier versions of the workflow builder used a **Clear existing property value** checkbox. The current builder uses the **Change type** menu instead. **Replace** overwrites whatever tag the contact already has.
:::

#### Tag value formats

You can assign more than one tag, by separating values with commas. The number of times a tag appears controls how often that banner displays, compared to the others.

- `sales`: a single tag.
- `sales, marketing, sales`: controls display frequency.
- `sales, marketing, sales, inbound24`: rotates banners.

### Step 11: Review the workflow and turn it on

The canvas now shows your trigger and a single action, reading **Set sgentags to accounting_industry**. Name the workflow, then select **Review and turn on**.

![The completed workflow canvas, showing the enrollment trigger and an Edit record action that sets sgentags](https://help.opensense.com/media/how-20to-20create-20a-20workflow-20based-20on-20contact-20proper-d18bb99e843e.png)

Matching contacts enroll, and their **sgentags** property is filled in with your tag value.

## Part 2: Match the tag to your Opensense campaign

The workflow writes a value to HubSpot, but nothing displays until a campaign in the Opensense portal has a tag that matches that value.

In the Opensense portal, go to **Marketing** > **Campaigns**, find your campaign, and confirm that its tag matches the **sgentags** value exactly. In this example, the campaign `accounting_vertical_webinar_2026` has the tag `accounting_industry`, which matches the value the workflow writes.

![The Opensense Campaigns page, with a campaign showing the tag accounting_industry under the campaign name](https://help.opensense.com/media/campaign-20with-20segment-20tag-625441bef03d.png)

:::caution[Tags must match exactly]
Use only lowercase letters, numbers, and underscores. Tags are case-sensitive, and spaces, hyphens, and other characters won't match. `accounting_industry` and `Accounting Industry` are two different tags, and the second one will never resolve to a banner.
:::

## Part 3: Verify the banner resolves for a recipient

When the workflow has run and the campaign is set up, confirm that the correct banner is selected for a specific contact, before you roll out the workflow more widely.

1. In the Opensense portal, go to **Manage** > **Integrations**.
2. Select your HubSpot integration.
3. Open the **Diagnostics** tab.
4. In the **Diagnostics** field, enter the email address of the contact record you're testing with.
5. Select **Refresh**.

![The HubSpot integration's Diagnostics tab, with an email address entered and the Refresh button](https://help.opensense.com/media/abm-20testing-20-20hubspot-20integration-20diagnostics-819998b39c0a.png)

Check the **Rendered HTML** section. It shows the ad token selected for that recipient: in this example, `[[ad:accounting_vertical_webinar_2026]]`, the campaign matched by the `accounting_industry` tag.

![The Diagnostics tab, with the Rendered HTML section showing the resolved ad token for the tested recipient](https://help.opensense.com/media/abm-20testing-20-20hubspot-20integration-20diagnostics-20result-0e7503d75e8e.png)

If **Rendered HTML** shows the campaign name you expected for that recipient, it worked. If it shows a different campaign, or no ad token, work through the troubleshooting below.


## Troubleshooting

<div class="kb-faq">
  <details id="rendered-html-shows-no-ad-token-for-the-test-recipient">
    <summary><span class="kb-faq__question">Rendered HTML shows no ad token for the test recipient</span></summary>
    <div class="kb-faq__answer">
      <p>Check that the contact actually enrolled in the workflow, and that <strong>sgentags</strong> is filled in on their contact record in HubSpot. If the property is empty, the contact didn't meet your enrollment criteria. Go back to <a href="#step-5-set-your-enrollment-criteria">Step 5</a>, especially the <strong>Viewing</strong> menu, and confirm that you filtered on the object you intended.</p>
    </div>
  </details>
  <details id="sgentags-is-populated-but-no-banner-resolves">
    <summary><span class="kb-faq__question">sgentags is filled in, but no banner resolves</span></summary>
    <div class="kb-faq__answer">
      <p>Compare the tag on the campaign with the value in <strong>sgentags</strong>, character by character. Capital letters, spaces, and hyphens are the most common causes. Confirm that the campaign status is <strong>Active</strong>.</p>
    </div>
  </details>
  <details id="the-wrong-banner-shows-for-a-contact">
    <summary><span class="kb-faq__question">The wrong banner shows for a contact</span></summary>
    <div class="kb-faq__answer">
      <p>A contact may have tags from more than one workflow. Check the full value of <strong>sgentags</strong> on the contact record. If it holds several comma-separated tags, banners rotate among the matching campaigns. If a workflow should overwrite previous tags, set <strong>Change type</strong> to <strong>Replace</strong>, rather than <strong>Add to current value</strong>.</p>
    </div>
  </details>
</div>

## What's next

- [Creating a banner campaign](https://help.opensense.com/docs/creating-banner-campaign)
- [Selecting tags for a campaign](https://help.opensense.com/docs/creating-banner-campaign#3-select-tags)
- [Connecting HubSpot to Opensense](https://help.opensense.com/docs/hubspot-integration)

For further help, contact Opensense Support at [help@opensense.com](mailto:help@opensense.com).
