HockeyStack Academy 101 - Goals
This guide gives you insight into goals - 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. 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.
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
/./
\d
matches 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