Assigning Opensense tags with a HubSpot workflow
Overview
Section titled “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.
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
Section titled “Part 1: Build the HubSpot workflow”Step 1: Start a new workflow
Section titled “Step 1: Start a new workflow”In HubSpot, go to Automations > Workflows, then select Create workflow.

Step 2: Choose From scratch
Section titled “Step 2: Choose From scratch”In the Create workflow menu, select From scratch.

Step 3: Choose a trigger type
Section titled “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.

Step 4: Choose the record type that can enroll
Section titled “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.

Step 5: Set your enrollment criteria
Section titled “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:
- Contacts (primary)
- Properties on the enrolled contact record itself, such as Job Title or Lifecycle Stage.
- An associated object
- Properties on a record the contact is associated with, such as Company or Deal.
- A custom object
- Any custom object in your portal, listed under Custom Objects at the bottom of the menu.

When you’ve chosen an object, pick a filter type, using the tabs under the menu:
- Properties
- Filter on a property value, such as Industry or Country.
- Events
- Filter on an activity or event.
- Memberships
- Filter on list, workflow, or import membership.

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

Step 6: Review the criteria group and continue
Section titled “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”.

Step 7: Set re-enrollment, then save
Section titled “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.

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
Section titled “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.

Step 9: Choose the sgentags property
Section titled “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).
Step 10: Set the tag value
Section titled “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.

Tag value formats
Section titled “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
Section titled “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.

Matching contacts enroll, and their sgentags property is filled in with your tag value.
Part 2: Match the tag to your Opensense campaign
Section titled “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.

Part 3: Verify the banner resolves for a recipient
Section titled “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.
- In the Opensense portal, go to Manage > Integrations.
- Select your HubSpot integration.
- Open the Diagnostics tab.
- In the Diagnostics field, enter the email address of the contact record you’re testing with.
- Select Refresh.

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.

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
Section titled “Troubleshooting”Rendered HTML shows no ad token for the test recipient
Check that the contact actually enrolled in the workflow, and that sgentags 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 Step 5, especially the Viewing menu, and confirm that you filtered on the object you intended.
What’s next
Section titled “What’s next”For further help, contact Opensense Support at help@opensense.com.



