The Arithmetics component's Visual editor helps with changing rates, converting currencies, etc, in a more convenient way than via JSON-code.
This editor is used on integration Config page and on Macros page, since the Arithmetics component can be turned into macro for re-usage and easier support purposes.
The component's tech name is
transform/hulk, hence the possible
hulk namings below.
In the Visual editor, each line is a group that holds conditions that must be met within a stats row for the result to be calculated and the expression itself.
For each statistics row the Arithmetics
map's being applied downwards starting from the group at the top:
- simple expression
expression- action [operator] digit - the expression that calculates the result, where
- "field" - action: installs/views/purchases/etc
- operator -
- digit - the rate
filter- if the conditions set in this field match the statistics row - result will be calculated using the
expressionexpression and this row's processing stops - no more Arithmetics groups will be applied to this row; otherwise the row will be ignored.
- JSON Advanced
Same as for the simple expression, but with a JSON filter.
Problem: higher group's conditions match all the needed rows of incoming stats hence for all those rows Arithmetics will calculate the 0 result:
- All the rows with
campaignfield will be calculated using the
installs * 0expression.
campaignrows will be calculated using these expressions, hence the resulting stats will be corrupted.
- All the rows with
Solution: change the groups order
- Move the slider down to get the group to its correct position.
iOSrows will be calculated using the upper group rates. All the other rows - using the lower group rates.
Rows that don't match the higher group's conditions will be calculated using the lower group's ones.
That processing order gives an option of setting default rates: for all the rows that haven't matched any groups' conditions - the lowest group's expression (that only has, say, the campaign/country column) will be applied.
How to use
To open the add-on, do the following:
Current relevance (macro's one on the screenshot below) properties ("..." button) > Edit As > Arithmetics.
In the Visual editor window, make the edits. Here's what you can do in the add-on:
Open the group to see which rates are set in it (hint: you can tell it already by the columns keys);
_exp_contains the JSON-code
Click the column key to open the column (it will be underscored when opened)
Drag&drop the column keys to change their order and the group view.
Select the column to perform a column editing action:
delete, clone (2.1 in the screenshot below), duplicate the column(-s) in a new group (TO GROUP, 2.2 in the screenshot below), add column, edit column key (click ... for this one)
Save the edits and exit add-on by clicking DONE.
Create new group
Click CREATE GROUP and select either Simple or JSON Advanced.
For the new group, enter the action that's used for calculations in this group (say,
install) and add column setting its key and value(-s). Multiple values are to be line break separated.
If the stats is being filtered by more columns, add them on by one. Every column's value will be added into the
values number Adding column Result 1 value multiple values
Sorting by other columns
Drag&drop groups to change their order
Edit the JSON filter, if needed.
When you're done creating this new group, click DONE to save and exit the add-on
Edit existing group
- Find the group you need (keep in mind that Search field can be both case sensitive and case insensitive)
- Edit it
- Click DONE to save and exit the add-on
- Click the green SAVE button to save the config
- Make sure you've edited all the required date range relevances
You need to add another campaign
cmp with the same rates set as for
desktop platform, with different rates values (
- Find, selected the group and clone it.
- Change the
cmpand its rates to
- Click DONE