Learn about Goal Tracking

On this page we explain you what does "goal tracking" mean. But if you already know please just jump straight to the point: How to manage "goal-tracking"? :-)

Content of this page

What is "goal tracking"?

First of all let's clarify the term "goal": this is YOUR goal. It means something which is important for you as website owner.

And this leads to the following simple definition of "goal tracking": the Visitor behaved during the visit on your website which fulfills the criteria of your "goal" definition.

If that happens, Keytiles fires an Event - increasing the count of it. And by observing how many times the Event fired you can track how many visits of Visitors reached YOUR goal.

Some quick examples

To build better understanding let us give you a few possible "goal" definitions you might be interested in to track:

(You should keep reading the article but if you are less patient and curious immediately how you can implement these later int the article we show the setup of these examples ;-))

  • "Visitor visited at least 5 contents (Tiles) during the visit"
    So (s)he made a long visit on your website, your content is clearly successful as it is engaging Visitors.
  • "Visitor spent more than 5 minutes during the visit"
    Similar to the above but focusing on reading / browsing time instead of how many contents were checked during this time.
  • "Visitor made a purchase after reading our special offer"
    Pretty much self explanatory goal right?
  • "Visitor came from Facebook or Instagram to our website and later (s)he made a purchase" or more generic "Visitor came from a social platform to our website and later (s)he made a purchase".
    You can measure success of your social media presence.
  • Similarly "Visitor came from a search engine to our website, saw our special offer and later (s)he made a purchase"
    You can measure success of your SEO strategy.
  • "Visitor came from our e-mail Campaign and during this visit (s)he checked our special offers"
    You can measure success of your Campaign strategy.

Simple no?

You can combine many things in the criteria which is known about a visit. And this leads to the next point - keep reading...

Role of "visit session"

If you read the above examples you can notice a trivial thing: none of the above questions can be answered without somehow joining different "clicks", different actions your visitor made into something we call: "the visit".

You simply need to know which actions have happened within one visit of the visitor, even in which order. This is what we call "visit session". And Keytiles is capable of doing this so we have it! If you are curious about how does it work, you can check this article. But what is important to note here is: VisitSession works in Keytiles even without any cookie (in this case with ~98.5% precision - yes, we track it that's how we know:-)) so this is a pretty much reliable functionality we can absolutely build on!

How to manage "goal tracking"?

To manage this you need to be in "admin" role in the Data Container.
If you are not admin you can just view the rules but can not change them.

It is easy. Basically you need to phrase so called "goal tracking rules".

Opening the editor

  1. On the UI just go to the Data Containers page (https://gui-test.keytiles.com/system/data-containers)
  2. You see there how many goals are configured - this is a link, simply just click it!

    goaltracking-editor-how-to-open.jpg

The "goal tracking rule"

In this editor you can manage goal tracking rules where each rule consists of:

  • condition - an expression which if evaluates to True then the criteria is fulfilled and an event is triggered as the goal is reached.
  • event setup - which drives what event is fired and how does it behave when condition is met.

additionally, you can also give it

  • title - which is used to display this rule on the UI so your colleagues can recognize this (keep it short but descriptive).
  • description - as free text to provide some explanation what/why it does.

Simple like that.

You can have of course multiple goal tracking rules so you can track the success of multiple "goals".

Condition

Condition is a logical expression which if evaluates to true then the event (see below) is fired.

The editor will evolve in future releases - for now we provide the future "advanced" view when you can/need to provide the expression like programmers do in an if-then structure.

The expression works in the following syntax:

  • operator == - testing equality
  • operator <, <=, >, >= - greater, greater or equals, etc
  • operator ! or != - negate or not equals
  • operator && - logical AND operation
  • operator || - logical OR operation
  • you can also use ( and ) 

Examples:

  • (condition1 && condition2) || condition3 - evaluates to true when either condition1 AND condition2 are both true OR condition3 is true
  • expr1 == 5 || expr2 == "value" - evaluates to true if expr1 is 5 (numeric) OR expr2 is string "value"

At the moment only "VisitSession based goal tracking" is available (the most important one which joins multiple actions a visitor made during a visit)

Built in expressions

The term visit defines expressions provided by the VisitSession while term hit defined expressions over the incoming event.

VisitSession expressions

  • visit.length() : integer
    Returns the length of the VisitSession - how many actions the visitor made.
  • visit.lengthInSeconds() : integer
    Returns the length of the VisitSession - how long it is measured in seconds.
  • visit.isNewVisitor() : boolean
    Returns true if the visitor is a new visitor.
    note: requires tracking cookie!
  • visit.isReturningVisitor() : boolean
    Returns true if the visitor is a returning visitor.
    note: requires tracking cookie!
  • visit.isFirstToday() : boolean
    Returns true if we have seen the visitor (in reality, a device...) first time today so this is the first VisitSession from the visitor. All later VisitSessions today will return false.
    Helps to implement answer for question "how many visitors (in reality, devices) we have reached today?"
    note: requires tracking cookie!
  • visit.hasTrackingCookie() : boolean
    Tells if the VisitSession was created based on explicit tracking cookie (some features require presence of tracking cookie)
  • visit.tileReceivedEvent(String tileId, String eventType) : boolean
    Returns true if Tile with tileId received event eventType during the VisitSession.
    Typically you do not do this in the condition for one Tile because then you simply see that event. But it makes more sense to combine if multiple Tiles the visitor actioned.
    E.g.: visit.tileReceivedEvent("special-offer", "pageview") && visit.tileReceivedEvent("basket", "purchase")
  • visit.tileGroupPathReceivedEvent(String tileGroupPath, String eventType) : boolean
    Returns true if a specific content section received a specific event.
    You can use * character to substitute any characters.
    E.g. visit.tileGroupPathReceivedEvent("/politik", "pageview") && visit.tileGroupPathReceivedEvent("/witschaft", "pageview") || visit.tileGroupPathReceivedEvent("/wirtschaft/*", "pageview") returns true if during the visit the visitor viewed any article from "politik" content area and at least one article from "wirtschaft" or any of its sub areas.
  • visit.tileGroupPathCountReceivedEvent(String eventType) : integer
    Returns the number of content areas (like "/politik", "/wirtschaft" etc) which received the specific event.
    E.g. visit.tileGroupPathCountReceivedEvent("pageview") > 4 is true if the visitor during the visit visited at least one article from 4 different content areas.
  • visit.startedFromCampaign(String campaignName) : boolean
    Returns true if the visit started from the given campaign.
  • visit.startedFromCampaignMedium(String campaignMedium) : boolean
    Returns true if the visit started from the given campaign medium (e.g. "email")
  • visit.startedFromCampaignContent(String campaignContent) : boolean
    Returns true if the visit started from the given campaign content.
  • visit.startedFromReferrerCategory(String referrerCategoryName) : boolean
    Returns true if the visit started from the given external referrer category, which can be: "direct", "search", "link" or "social".
  • visit.startedFromReferrerName(String referrerName) : boolean
    Returns true if the visit started from the given referrer name, e.g. "Facebook", "Instagram", "LinkedIn", "Google", "Bing", etc.
    Tip: in TileView simply go to "external referrers" page - the names you see on Tiles you can write here.

Incoming event expressions

  • hit.eventType() : string
    Returns the type of the inbound event e.g. "pageview", "view", "download" and so on
  • hit.isAnyOfEventTypes(String... eventTypes) : boolean
    Returns true if the inbound event type is one of the listed ones.
    Instead of writing this hit.eventType("pageview") || hit.eventType("60 secs spent") you can simply write hit.isAnyOfEventTypes("pageview", "60 secs spent")
  • hit.visitorType() : string
    Returns the type of the visitor like "free" or "paid" (this requires customization of your tracking!)
  • hit.isAnyOfVisitorTypes(String... visitorTypes) : boolean

Event (to fire) setup

In this block you can setup the goal tracking event which is fired (so later you see this) when condition evaluates to True.

  • Event name
    The name of the event (you will see this on UIs / query results). Keep it short and concise as much as possible, recommended max 20-25 characters.
  • Inherit tile
    If you tick this then the goal tracking event will be associated with the same Tile the inbound event was associated with.
    Ticking this in just makes sense if you phrased a condition which really makes sense to associate with a Tile. For example writing condition like visit.length() == 5 does not make much sense to be associated with a Tile as then it would look like that the event counters of the Tile is increased which was actually the 5th actioned Tile during the visit. But how is it different compared to the 2nd, 3rd, 4th actioned Tile? Woul be fuzzy...
  • Skip unique filter
    By default a goal tracking event is only triggered once during the same visit - no matter how many times the condition evaluates to True.
    So e.g. if you write visit.length() >= 5 which would be true after 5 actions made always, the goal tracking event would just fire when length of VisitSession becomes 5. And when it is 6, 7, 8, ... and so on, would not, as it was already fired.
  • Only if original event fired
    The "original event" is which came in into Keytiles from outside. Like "pageview", "view" or "60 secs spent" custom event. ("goal tracking" events always coming from inside if "condition" evaluates to True remember?) When ticked on then the "goal tracking" event is only fired if this original event was not filtered out. Why would we filter out the original event? Well just one example: unique "pageview". Which means if your visitor is reading a content (Tile) and hits browser "refresh" 4 times, "pageview" events are filtered out as that Tile was already viewed during the VisitSession (=unique). 

Some quick examples - resolved

As now in this article we wrote about how "goal tracking" works and you also saw the built in expressions to manage conditions as well as event setup let's revisit the examples we mentioned above and now show the goal tracking setup for them. 

"Visitor visited at least 5 contents (Tiles) during the visit"

Condition: visit.length() == 5

Event setup:

  • Event name: 5 long visit
  • Inherit tile: Off
    This does not really bring relevance which Tile (content) sent the 5th action triggered the condition so better to handle this as site-global event.
  • Skip unique filter: Off
  • Only if original event fired: does not really matter
    Because if Keytiles filters out an inbound original event that one does not increase the VisitSession length then either so does not count to length condition... Here this does not matter will just work.

"Visitor spent more than 5 minutes during the visit"

Condition: visit.lengthInSeconds() >= 300

Event setup:

  • Event name: 5 min visit
  • Inherit tile: Off
    This does not really bring relevance which Tile (content) was active when the action triggered the condition so better to handle this as site-global event.
  • Skip unique filter: Off
  • Only if original event fired: Off
    Because even if Keytiles filters out an inbound original event that one still increasing VisitSession length in seconds. And for us this means the visitor is still on our website.

"Visitor made a purchase after reading our special offer"

Assuming tileId of our special offer page is "tile-special-offer", our checkout page tileId is "checkout" and name of (custom) event sent in case of purchase is "purchase"
Condition: visit.tileReceivedEvent("tile-special-offer", "purchase") && visit.tileReceivedEvent("checkout", "purchase")

Event setup:

  • Event name: special offer purchase
  • Inherit tile: Off
    This feels more as site-global event no?
  • Skip unique filter: Off
  • Only if original event fired: does not really matter

"Visitor came from Facebook or Instagram to our website and later (s)he made a purchase"

Assuming tileId of our checkout page is "checkout" and name of (custom) event sent in case of purchase is "purchase"
Condition: hit.isAnyOfEventTypes("purchase") && (visit.startedFromReferrerName("Facebook") || visit.startedFromReferrerName("Instagram"))

Event setup:

  • Event name: FB/Insta started purchase
  • Inherit tile: On
    Please note that in the condition now we are capturing the "purchase" incoming event and checking in that case if the visit was started from FB or Insta!! Which means user is on the right Tile now (checkout page). And if we inherit this Tile then it will become a more intelligent "purchase" event on that Tile this way - even TileView would show over the checkout page in this case. Which is cool!
  • Skip unique filter: Off
  • Only if original event fired: Depends on how you setup "purchase" event. So I would say does not really matter here, I would leave it On

"Visitor came from a social platform to our website and later (s)he made a purchase".

Like the above just the condition is slightly different (much simpler):
Condition: hit.isAnyOfEventTypes("purchase") && visit.startedFromReferrerCategory("social")

Post checks - Troubleshooting

After you added goal trackings OR it is suspicious that somehow the tracking does not work as expected it makes sense to check the so called "hit faults" Keytiles is generating.

In case something is wrong with things like conditions setup or evaluating the goal tracking rule Keytiles will generate entries there with error code VISITSESSION_GOAL_TRACKING_FAILURE. By observing these errors you might even fix the problem by yourself.

You find more details here about how to check these errors!