Goal facts

You can use the following facts to set up your targeting for conversions.

Visits User actions Technology User history & data Misc
Days Custom fact Browser language Cookies If block
Month Exit intent Device Data layer Push goal
Page Content Goal history Screen width Geo data  
Page views Interaction   Revenue  
URL Content in view      
Referral type Scroll from top      
Referral URL User inactivity      
Time        
Total visits        

 

Visits

Days

mceclip1.png

Used to only register the goal on a specific day(s)

 

Month

mceclip2.png

Used to only register the goal on a specific month(s)

 

Page content

mceclip3.png

Set an element that needs to exist on the page for the goal to register. Enter the CSS selector of the element and choose if you just want to check if it exists or if you also want it to match some specific text inside it by choosing match type in the dropdown and enter the text that need to be matched in the second input field. In the example above the goal will register if an element with the selector .search input exists on a page the visitor visits. The difference between Exact match, Simple match, Contains & Regex

 

Page views

mceclip4.png

Set the number of pages that needs to be seen before the goal should register

 

URL

mceclip5.png

Set an URL match that needs to be fulfilled for the goal to register. The difference between Exact match, Simple match, Contains & Regex

 

Referral type

mceclip6.png

Choose a referral type (Organic, Social, or Referral (other) ) that needs to be fulfilled for the goal to register

 

Referral URL

mceclip7.png

Target a specific referrer by URL that needs to be fulfilled for the goal to register. The difference between Exact match, Simple match, Contains & Regex

 

Time

mceclip8.png

Set time of day that needs to be fulfilled for the goal to register

 

Total visits

mceclip9.png

Set the number of visits that need to be done before the goal is registered. The count starts at 1 for first time visitors.

 

User actions

Custom fact

mceclip0.png

Set your own javascript statement and call factSuccess(); to register the goal.

 

Exit intent

mceclip11.png

Register the goal if the user intends to leave the website (only for desktop)

 

Goal history

mceclip12.png

Register the goal only if another goal has been satisfied first.

 

Interaction

Register the goal if a visitor clicks on a specific element. Enter the CSS selector for the element as the value. You can also add a custom event handler if there is something that needs to be checked when the click happens. To do so simply click Add event handler and write your javascript check and return factSuccess(); if true.

 

Content in view

Set a percent or pixel limit the visitor needs to cross for the goal to register. In the example above the goal will registeer if the visitor scrolls down and see 20% or more of the element with a class called recom-items-container.

 

Scroll from top

mceclip14.png

Set a percent or pixel limit the visitor needs to cross for your goal to be registered. In the example above the goal will register if the visitor scrolls 20% from top of the page.

 

User inactivity

mceclip15.png

Set number of seconds of inactivity by the visitor before your goal is registered

 

Technology

Browser language

mceclip16.png

Checks the value in navigator.language and registers the goal if matched

 

Device

mceclip17.png

Set the device(s) that needs to be matched for your goal to register.

 

Screen width

mceclip18.png

Set the screen width (on load) that needs to be matched for your goal to register

 

User history & data

Cookies

mceclip0.png

Register the goal if a cookie exists and/or matches a value. The difference between Exact match, Simple match, Contains & Regex

 

DataLayer

mceclip1.png

Register the goal if a dataLayer key exists and/or matches a value. The difference between Exact match, Simple match, Contains & Regex.

Another example

Data layer event:

{
    "ecommerce": {
        "id": "123456-0123",
        "name": "Super nice product",
        "discount": 0,
        "quantity": 1,
        "currency": "SEK",
        "price": 599
    },
    "event": "addToCart"
}

Let's say you want to register a conversion for add to cart, but only if the product value is over 500. You can now check for the key that holds this (in this example ecommerce.price), and then set to match only values over the intended value (in this example 500). Then you set to check for a specific event (in this example addToCart).

check for price

 

Advanced example

Data layer event:

{
    "event": "purchase",
    "ecommerce": {
        "items": [
            {
                "item_id": "43141-0014",
                "item_name": "Standard t-shirt",
                "item_category": "t-shirt",
                "price": 249,
                "discount": 0,
                "quantity": 1,
                "size": "Medium"
            },
            {
                "item_id": "754634-0508",
                "item_name": "Original Sneaker",
                "item_category": "shoes",
                "price": 699,
                "discount": 0,
                "quantity": 1,
                "size": "44"
            },
            {
                "item_id": "563734-0056",
                "item_name": "Perfect pants",
                "item_category": "pants",
                "price": 379,
                "discount": 0,
                "quantity": 1,
                "size": "Medium"
            }
        ],
        "value": 1327,
        "currency": "SEK"
    },
    "gtm.uniqueEventId": 434
}

Let's say you want to trigger a popup for visitors that have purchased a product that is from a specific product category. As the visitor might buy more than one product and not necessarily from the same category we will need to check all purchased products. You can now easily set that up via a data layer statement.

To set up as per the example above we set the key to the path for purchased products and then make use of the wildcard (x) to check for all products (in this case the key will be set to ecommerce.items[x].item_category) and then set the value to the category we want to target value (in this case shoes). Then we set to check for a specific event and enter the event name (in this case purchase).

Check for category

 

Geo data

mceclip2.png

Register the goal if the visitor is/isn't from a specific country, region, or has/hasn't a specific IP address

 

Revenue

Add this fact to get revenue data connected to the goal. Notice that this needs a callback to populate the values. See How to implement revenue tracking

 

Misc

If block

mceclip6.png

A block used for grouping statements. If you use Match all, then all statements need to evaluate to be true in that block for the entire block to be true. If you use Match one of, then only one statement in that block needs to evaluate true for the entire block to be true.

 

Push goal

mceclip1.png

Callback that needs to be implemented that will register a conversion when called.

Was this article helpful?
0 out of 0 found this helpful