HockeyStack Academy 101 - Goals
This guide gives you insight into goal - actions based on a specific ruleset that you define.
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.
โ

โ
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.
โ
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.
AND is used when the conditions in the statement need to be true. For instance, if you want to filter for users who are from Canada AND have made a purchase, both conditions must be met for the user to be included in the filter.
OR is used when at least one of the conditions needs to be true. If you want to filter for users who are either from Canada OR have made a purchase, the user will be included in the filter if they meet either one of these conditions.
Letโs think of a person called Michael Scott, whoโs from the US and have made a purchase.
Letโs say we want to create a filter that says that a user is from North America, meaning they have to be either from Canada or from US.
The logic is: โUser is from Canada OR User is from USโ. In the case of Michael,
- User is from Canada = FALSE
- User is from US = TRUE
OR logic is used, meaning only one of them have to be true for the entire statement to be true. Therefore, Michael matches our filter, and is deemed to be from North America.
Now, a more complex example is if we want to create a filter that says a user is NOT from North America.
Most marketers get this part wrong.
Your natural instinct would be to say โUser is NOT from Canada OR User is NOT from USโ. In the case of Michael,
- User is NOT from Canada = TRUE
- User is NOT from US = FALSE
OR logic is used, meaning only one of them have to be true for the entire statement to be true. Therefore, Michael matches our filter, and is deemed to be NOT from North America! That is incorrect.
So in this case, the correct filter is: User is NOT from Canada AND User is NOT from US.
When AND logic is used, both statements have to be TRUE for the overall statement to be TRUE. Therefore Michael will not match this Non-North America filter, which is our expected behavior.
A lot of times, in HockeyStack, you will start building a filter with a top-level OR block, and then want to switch the top level block to AND.
Example: We want to create a defined property for LinkedIn Ads visits. We start by defining our UTM Sources.
โ

โ
Now, you want to specify that the Touchpoint Type for both should be Website Session. You have two ways of doing this.
1. Directly add it under the bottom level AND
โ

2. You can โSwitch And/Orโ, and add it at the top level. This is the more scalable solution. If you were to add another OR block on Option 1, you would have to add 2 filters, vs. only 1 filter with the below approach.
โ

โ
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.
For example, youโre looking for UTM Campaigns that either include โ_brand_โ in the middle of the text, or โ_brandโ at the end of the text, or โbrand_โ in the beginning of the text. If you were to do a โcontains โbrand_โโ, this would also match โnonbrand_โ, which you definitely donโt want. In this case, you would do โmatches regex /_brand_|^brand_|_brand$/โ to get the correct filter.
I know this looks really complex, but donโt get discouraged โ itโs actually pretty easy! Letโs break it down.
- Every Regex would start and end with
/. This denotes that this is Regex and itโs not just some random text. - The
|symbol means โORโ. You can think of this as a replacement for,when saying โcontains one ofโ
So, if you want to create a filter that says โDeal Type contains one of Renewal, Upsell, Cross-Sellโ, your regex would be: /Renewal|Upsell|Cross-Sell/
- The
^symbol means this is the beginning of the text. - The
$symbol means this is the end of the text.
So if you want to create a filter that says โUTM Campaign is emptyโ, your regex would be /^$/ . You want to match, the beginning of the sentence, and the end of the sentence, with no text in between, which means it is empty!
- The
.symbol matches any character. - The regex for โis not emptyโ would be
/./ \dmatches any number- If you use any of the above characters in your match, you should preface it with
\to say that โthis is not a special character. this is just the text I want to match.โ For example, a UTM Campaign containing โ|โ would have to be matched like this:/\|/ - Regex in HockeyStack is case sensitive.
You can use regex101.com to test your regex. (You can omit the / when testing here)
โ
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.
HockeyStack can translate date fields into actions using a setting called โTrack Date Propertiesโ
Currently, this setting is only available for Salesforce, HubSpot and Marketo integrations.
Navigate to Settings > Reporting & Tracking to find the Track Date Properties section.
You will need 3 pieces of information:
- The integration to pull the data from
- The object where the date field residessome text
- Available objects for Salesforce:some text
- Lead: This will pull from both Lead and Contact.
- Deal: This will pull from Opportunity
- Company: This will pull from Account
- Campaign Member: This will pull from CampaignMember
- Available objects for HubSpot:some text
- Contact
- Company
- Deal
- Available objects for Market:some text
- Lead
- Available objects for Salesforce:some text
- The API name of the date fieldsome text
- Salesforce: https://help.salesforce.com/s/articleView?id=000385500&language=en_US&type=1
- HubSpot:
- Finding Internal Field Names in HubSpot
Examples of Goals
Any Form Submission
Step 2.2 - Create your KPI goals



