OCTOBOARD
English
PRICING
RESOURCES
LOGIN
TRIAL
TRIAL
English

Using rules in custom metrics: calculating tax

Using rules in custom metrics: calculating tax

Using IF-THEN rules in metrics: calculating tax

If you want to build a more complex rule that needs conditional logic, you can use the IF-THEN rule. In this example, we will create a Tax (VAT) metric that calculates tax on advertising based on the market (Country).

The rule will calculate VAT for ad spending in the United Kingdom (20%) and the Republic of Ireland (23%).

You can build such a metric in any of the Paid Advertising platform streams separately or at the Multi-Channel level for all your advertising spend.

In this example, we will build a formula for the Combined Data Stream. Locate the stream in the PPC Analytics panel on the left and click on its name:

Combined data stream

In the stream metrics list click the “ADD FORMULA” button:

Add formula button in combined data stream

Give the new metric the name “Tax (VAT)” and click the “ADD RULE” button shown below:

Add new rule to tax metric

In the rule edit panel, you will need to select “IF-THEN” radio button and configure your rule to multiply the cost by 0.2 or 0.23 for the UK and Ireland respectively. This is what the rule definition will look like:

Tax calculation rule

Click the APPLY button and preview the results in the Data Explorer widget before implementing the change. The final result will look like this:

Cost by country including tax

Note that the Tax (VAT) column now has tax values for the United Kingdom and Ireland.

You can also check some of our advanced rule examples in the following tutorials: