Before you begin: This guide shows you how to create calculations in TapClicks. Calculations let you create new metrics for reporting based on existing connector data. For example, to average two numbers, you can create a calculation that produces that average and then use it in your reports.
Calculations also work with channels. You can combine multiple data sources in a channel and then create a calculation that spans all of them. For example, you can create a channel that combines several call-tracking data sources, then create a Cost per Call calculation that divides Total Cost by Total Calls across all of those data sources.
How to Create a New Calculation
1] In the left side menu, on the Data menu, click Calculations.
2] The Calculations page appears.
3] In the upper-right corner, click the Add New Calculation (plus sign) icon.
4] The New Calculation page appears.
Define the Calculation and Data Source
To define the calculation, give it a name, then specify the data type, data source, and data view.
5] Enter a name for the calculation in the Name field.
6] From the Data Type dropdown menu, choose a data type. The data type is the output your calculation produces.
7] From the Data Category dropdown menu, select a data source (connector or channel) to provide inputs to your calculation.
8] From the Data View dropdown menu, choose the data view you want to use in your calculation. If you are not sure which data view has the metrics you want, search for your data source on the TapClicks Connectors page to see its data view and metric details.
| Note: The options available in the Data View dropdown menu depend on the data category you chose in step 7. |
Build a Calculation
This section describes the ways to build a calculation, the components of a calculation, and guidelines for typing directly in the Calculation Builder.
| Note: You only see metrics that are currently active in your data source. If a metric is not available, check your data source. |
Ways to build a calculation
You build calculations in the Calculation Builder in one of two ways:
- Type directly in the Calculation Builder.
- Click the menu items and operators on the right.
Calculation components
Calculations consist of four components:
- Math operations: +, -, *, /, ()
- Functions: sum, average, count, min, max
- Metrics: CPC, clicks, impressions
- Logical operations: AND, OR, =, !=
Typing guidelines
When the Advanced Calculation toggle is on, use the following guidelines to type directly in the Calculation Builder:
- Type @ to reference any available metric.
- Type = to reveal all available functions.
- Wrap text elements in quotation marks (" ").
Build a Basic Calculation Example
This example builds a basic calculation for click-through rate (CTR) using the following formula: clicks / impressions * 100.
9] Turn off the Advanced Calculation toggle.
10] Click the Clicks metric.
11] The Clicks metric appears in the Calculation Builder.
12] Click the division ( / ) operator.
13] Click the Impressions metric.
14] Click the multiplication ( * ) operator.
15] Enter 100. The Calculation Builder should look like this:
16] Click Verify below the Calculation Builder.
17] If there are no errors, a green confirmation briefly appears below Verify.
18] Click Save. If the calculation saves successfully, a confirmation briefly appears below Save.
19] When you return to the Calculations page, the calculation you created appears in the list.
Build an Advanced Calculation Example
This example uses the advanced Calculation Builder to create a conditional statement that calculates the average clicks for a specific ad campaign.
20] Make sure the Advanced Calculation toggle is turned on.
21] Click the Functions tab and select IF.
22] The Calculation Builder populates with the IF conditional statement.
23] Click metric, then click the Fields tab and select Campaign Name.
24] Click operand, then click the Operators tab and select = Is equal to. Alternatively, double-click operand and type =.
25] Double-click condition and type the name of the campaign you want to calculate the average for.
26] Click result 1, then click the Functions tab and select AVG(value).
27] Click value inside the AVG function, then click the Fields tab and select Clicks.
28] Double-click result 2 and enter 0. When you are finished, the Calculation Builder should look like this:
29] Click Verify below the Calculation Builder.
30] If there are no errors, a green confirmation briefly appears below Verify.
31] Click Save. If the calculation saves successfully, a confirmation briefly appears below Save.
32] When you return to the Calculations page, the calculation you created appears in the list.
Next Steps
To see a complete list of calculation functions, see Advanced Calculation Function Reference & FAQs.
For more information about calculations, see FAQs: Calculations.
To learn how Audit Logs can help you track changes to your calculations, see Understanding Audit Logs.