Goals

HockeyStack ingests data from many different sources, and transforms it into the unified data model we discussed in the previous guide. As a result, there will be thousands of variations of actions. To be able to make these actions usable, and to create some order out of chaos, HockeyStack allows you to define the most important ones as Goals.

Goals are nicknames you give to actions based on a specific ruleset. This can be used to define anything from KPIs like MQL, SQL, Opportunity Creation, to marketing & sales touchpoints like emails opened, calls made, ad clicks.

Let’s say you want to define Newsletter Opens as a Goal.

A Newsletter Open would refer to Emails Opened with a subject line containing “Newsletter: ”, and that were sent using HubSpot.

In HockeyStack terms, we want to find all actions where:

  • Action Name = “Email Opened”

  • The property “Email Subject” contains “Newsletter: ”

  • The property “Integration” is “HubSpot”

You can think of this as a 5th column in our actions table.

Timestamp

Entity

Action Name

Action Properties

Is this a “Newsletter Open”?

bugra@hockeystack.com

Email Opened

Email Subject: “Newsletter: 2024 SaaS trends“

Yes

michael@dundermifflin.com

Email Opened

Email Subject: “Thank you for signing up!“

No

richard@piedpiper.com

Email Sent

Email Subject: “Newsletter: 2024 SaaS trends“

No

If I were to create a report that counts Newsletter Opens, the only action that would be taken into account would be the action done by bugra@hockeystack.com, since that is the one matching all criteria.


In HockeyStack, navigate to Definitions > Goals.

This page is your main data dictionary.

You can click on the + icon on the top right corner to create a new goal.

The Goal Definition

To start defining a goal, click on the first dropdown and choose a goal type. There are 4 types you can choose from:

  • View: Pageviews

  • Click: Clicks on the website

  • Form Submit: Form submissions on the website

  • Custom Goals: Any goal that is not coming from the website tracking script

View

Pageview goals track all pageviews (regardless of whether the pageview was the session starting / landing page or not) that are matching a specific URL schema. This can be an exact match, a contains / not contains match, or a regex match. For more technical context, this will be all actions with action_type = enter-page , filtered using page_url .

You can also filter a pageview using the source of the session that the it happened in, using the auto-captured referrer, or the UTM parameters.

Referrer: The referring website automatically detected from the page visits. This will be “direct” if it’s a direct visit, and empty if the URL had UTMs. Otherwise it will show the domain of the referring website, including the TLD (.com, .tr, .ai, etc.)

UTM Parameters: The company-defined UTM parameters pulled directly from the page visit URL.

Click

Most other analytics tools ask you to “tag” clicks before you are able to track them. Then, the tracking begins from the moment you tag them.

HockeyStack tracks all clicks on your website by default. So, you can create a click goal whenever you want, and you will still have the full history of clicks on it.

Click goals can be defined using the clicked element’s text, its CSS selector, or the URL the clicked link leads to. You can filter a click goal using the page where it happened.

Form Submit

Similar to clicks, HockeyStack also tracks all form submissions on your website. Form submission goals can only be defined using the CSS selector of the form element. Similar to click goals, form submission goals can be filtered using the page where it happened.

So, here’s a pro tip: Every CSS selector for a form element contains the word “form”. Therefore, a quick “Form submission contains form” goal would select all form submissions in your entire website. A “Form submission contains form, in page /xyz“ goal would select all form submission in a given page.

Custom Goal

“Custom Goal” means any action that is not a default website action. For more technical context, these actions have an action_type = custom .

Custom goals can be filtered using any of their action properties. Huge emphasis on this, because this is often confused with filtering via shared properties. Here’s an example to the difference:

You create an opportunity with Amount = 0 in Salesforce. HockeyStack receives a custom goal with the name Deal Created, with an action property deal_amount = 0 . You update the opportunity amount to $100k. HockeyStack receives a Deal Updated action with an action property deal_amount = 100000 .

In this case, if you were to define an goal that denotes all Deal Created actions with deal_amount ≥ 100k, the opportunity above would not be included because at the time of Opportunity creation, this opportunity had a deal amount of 0. The updated Amount is stored in Shared Properties, which currently can only be filtered inside a report. For more information about Shared Properties vs Action Properties, refer back to the data model article.

The Marketer’s Guide to AND / OR

AND / OR logic can be quite unfamiliar for most marketers, but it’s crucial to be able to create the correct filters in HockeyStack. Read more below.

The Marketer’s Guide to AND / OR in HockeyStack

Introduction

Creating effective filters in HockeyStack requires a solid understanding of AND/OR logic. While these concepts might seem complex at first, this guide will help you master them through clear examples and practical scenarios.

Basic Concepts

AND Logic

When using AND logic, all conditions in the statement must be true for a filter to match.

Example:

Filter: User is from Canada AND Has made a purchase

A user will only match this filter if they meet both conditions:

  • They are from Canada

  • They have made a purchase

OR Logic

When using OR logic, at least one condition must be true for a filter to match.

Example:

Filter: User is from Canada OR Has made a purchase

A user will match this filter if they meet either condition:

  • They are from Canada

  • They have made a purchase

Real-World Example: North America Filter

Let's follow a practical example with a user named Michael Scott, who:

  • Is from the US

  • Has made a purchase

Scenario 1: Filter for North American Users

To create a filter for North American users, we would use:

Filter: User is from Canada OR User is from US

For Michael:

  • ❌ User is from Canada = FALSE

  • ✅ User is from US = TRUE

  • Result: Filter matches (TRUE) because one condition is met

Scenario 2: Filter for Non-North American Users (Common Mistake)

❌ Incorrect Approach

Filter: User is NOT from Canada OR User is NOT from US

For Michael:

  • ✅ User is NOT from Canada = TRUE

  • ❌ User is NOT from US = FALSE

  • Result: Filter incorrectly matches (TRUE) because one condition is met

✅ Correct Approach

Filter: User is NOT from Canada AND User is NOT from US

For Michael:

  • ✅ User is NOT from Canada = TRUE

  • ❌ User is NOT from US = FALSE

  • Result: Filter correctly doesn't match (FALSE) because both conditions aren't met

Advanced Usage: LinkedIn Ads Visits Filter

When creating complex filters, such as for LinkedIn Ads visits, you have two approaches for structuring your filters:

Option 1: Bottom-Level AND

UTM Source = linkedin OR
UTM Source = linkedin.com
    AND Touchpoint Type = Website Session
(UTM Source = linkedin OR UTM Source = linkedin.com)
AND
Touchpoint Type = Website Session

The second approach is more scalable because:

  • It reduces redundancy

  • Makes it easier to add new conditions

  • Maintains cleaner filter logic

💡 Pro Tip

When building complex filters, start with your OR conditions grouped together, then use the "Switch And/Or" feature to add common conditions at the top level. This approach makes your filters more maintainable and easier to update.

Best Practices

  1. Always test your filters with known data to verify they're working as expected

  2. Group related OR conditions together

  3. Use top-level AND for conditions that apply to all criteria

  4. Double-check your logic when using NOT operators

  5. Consider scalability when structuring complex filters

In goals, the top-level logical operator is always OR. All page, source, property etc. filters added to blocks are AND blocks.

The Marketer’s Guide to Using Regex

Regex is an immensely powerful tool to search in text, and can be used to create goals and filters quickly without adding too many and/or blocks. Read more below.

The Marketer's Guide to Using Regex in HockeyStack

Introduction

Regular Expressions (Regex) is a powerful tool that helps you create sophisticated filters without complex AND/OR blocks. While it might look intimidating at first, this guide will break it down into simple, practical concepts that marketers can use daily.

Basic Syntax

The Building Blocks

💡 Important: Regex in HockeyStack is case sensitive

Common Use Cases

1. Contains One of Multiple Values

Instead of using multiple "contains" filters, use the OR operator:

/Renewal|Upsell|Cross-Sell/

This matches any text containing "Renewal", "Upsell", or "Cross-Sell"

2. Checking for Empty Values

To check if a field is empty:

/^$/

To check if a field is not empty:

/./

3. Brand Campaign Example

Let's say you want to match brand campaigns with these patterns:

  • "brand" in the middle

  • "brand_" at the start

  • "_brand" at the end

But NOT match "nonbrand_"

/_brand_|^brand_|_brand$/

Breaking it down:

  • _brand_ matches brand with underscores on both sides

  • ^brand_ matches brand with underscore at the start

  • _brand$ matches brand with underscore at the end

  • The | combines these patterns with OR logic

4. Special Character Matching

If you need to match special characters like "|" in your text:

/\|/

This tells regex to treat the "|" as regular text, not as an OR operator.

Testing Your Regex

  1. Paste your pattern (without the / delimiters)

  2. Test it against your sample text

  3. The website will explain each part of your pattern

Best Practices

  1. Start Simple: Begin with basic patterns and build up complexity

  2. Test Thoroughly: Always test your regex with various examples

  3. Document: Keep notes about what each regex pattern does

  4. Break It Down: Split complex patterns into smaller, understandable pieces

  5. Consider Case: Remember that HockeyStack regex is case sensitive

Common Patterns for Marketers

Need Help?

If you're unsure about a pattern:

  1. Break down what you're trying to match

  2. Test it on regex101.com

  3. Start with simple patterns

  4. Add complexity one piece at a time

Remember: Regex is a powerful tool that becomes easier with practice. Start with simple patterns and gradually build up to more complex ones as you become comfortable with the basics.

Track Date Properties

Sometimes, actions that you want in HockeyStack are not really stored as actions in your systems. The most common example date fields in CRM and Marketing Automation systems. Read more below.

Track Date Properties

Examples of Goals

Any Form Submission

Step 2.2 - Create your KPI goals

Last updated