Gtmhub allows you to create custom insights. These insights can be built directly within application. Once you build an insight, you can use it on InsightBoards, as well as in tracking the progress of your goals.

Insights consists of the three components: data, algorithm and user interface. Gtmhub provides numerous features to make the process of creating an insight a simple one. In the this article, we will demonstrate how simple it is to create a Gtmhub insight.

Hello World insight

To begin with, we'll create a simple insight which will only show "hello world" text on InsightBoards. Then, we'll move onto more useful examples.

  • Login to Gtmhub application
  • Click on the Setup tab, the Insights page will open
  • Click on the Build insight button and insight editor will open

Set the basic information on insight: 

  • Title: Hello World
    Title is how we will call your insight in the application
  • Hashtag: hello-world
    Hashtag is a unique name of your insight in the application. No two insights can have same hashtag. Hashtag has to start with a letter and contain only letters, numbers and underscores.
  • Description: My very first insight
    Description describes the purpose of an insight

Click on the Algorithm and Design tab. For this simple insight, enter following markup.

<h2>{{ data.message }}</h2>

For the algorithm, enter following R code.

out(message = "Hello World")

Click on the Execute button, to execute the algorithm and preview the insight.

Now, click on the Save button. Congratulations, you've just created your very first insight. You can go to InsightBoards and add your new Insight to one of them. Not sure how to do that? Learn how to visualize insights.

This short video demonstrates how to create a Hello World Insight in Gtmhub.

Creating an actual insight with metrics

Now that we have seen how easy it is to create a Hello World Insight in Gtmhub, let us create a more useful insight that will use actual data.

For this example, we'll need some data. The simplest way is to install a demo masterplan, which provides data. The demo masterplan creates three entities: Sales Opportunities, Sales Activities and Employees. These entities are populated with real data from a demo instance of MySql.

In this tutorial, we are going to create a simple insight that will show us the distribution of sales opportunities by their value.

  • Login to Gtmhub application
  • Click on the Setup tab, the Insights page will open
  • Before we start, let us examine the available entities. Click on the Entities tab.
  • You can see there are 4 entities present and three of them are connected to data sources (Orders entity is not connected).
  • Click on the Sales Opportunities entity
  • You can see the mappings between the remote data source and your entity, sync status and finally, the entity blueprint. Click on the Entity's blueprint tab
  • Here you can see the name of the entity, which is sales_opp. In addition to this you can see that the entity has four fields named deal_name, sales_rep_email, amount and stage.
  • Now, close the dialog and go back to Insights tab
  • Click on the Build an Insight button

Enter the following values for Name and Description:

  • Title: Deal distribution
  • Hash tag: deal-distribution
  • Description: Shows the distribution of deals by the deal size

Click on the Algorithm and design tab. In the left pane, which defines a view, paste following markup.

    <li>Count: {{ data.count | number }}</li>
        Large (over $100k): {{ data.largeCount }}
        ({{ data.largeCountShare * 100 | number : 2 }}%)
        Medium (over $30k): {{ data.mediumCount }}
        ({{ data.mediumCountShare * 100 | number : 2 }}%)
        Small (below $30k): {{ data.smallCount }}
        ({{ data.smallCountShare * 100 | number : 2 }}%)

In the right pane, which defines the algorithm, paste the following code.

deals <- entity("sales_opp")

# Get the number of all deals
count <- nrow(deals)

# Get all deals larger than 100,000
largeDeals <- filter(deals, amount > 100000)
# Count the number of large deals
largeCount <- nrow(largeDeals)
largeCountShare <- largeCount / count

# Get all deals larger or equal to 30,000 and smaller
# or equal than 100,000
mediumDeals <- filter(deals, amount >= 30000 & amount <= 100000)
mediumCount <- nrow(mediumDeals)
mediumCountShare <- mediumCount / count

# Get all deals smaller than 30,000
smallDeals <- filter(deals, amount < 30000)
smallCount <- nrow(smallDeals)
smallCountShare <- smallCount / count

    count = count,
    largeCount = largeCount,
    largeCountShare = largeCountShare,
    mediumCount = mediumCount,
    mediumCountShare = mediumCountShare,
    smallCount = smallCount,
    smallCountShare = smallCountShare
Did this answer your question?