This use case describes the logic and flow of adding tags to existing metrics in Anodot.
Use case description
Imagine an Ad-Tech company that is using Anodot's monitoring metrics capabilities for multiple customer accounts. At some point, they decide to have dedicated teams in charge of specific customer verticals (e.g., Fintech, Foodtech etc). In order to create dedicated alerts per vertical, the company uses Anodot’s tagging API to add a #vertical tag that will map between customer account IDs and specific verticals. This tag can then be used to group and filter the relevant #vertical metrics per each alert. Below is a general flow for creating and managing the #vertical tag logic via the tagging API:
1. Creating the tags
The initial tag logic will be created using the Assign Metrics to Tags API call (see example json below). As a best practice, we suggest keeping the json mapping and the tag ID, as they will be needed for future updates of the tag logic (see step 2.a below). The tag ID can be found in the call response. Here's an example of a single tag logic (#vertical=Fintech), mapping three distinct accounts:
{ "expressions": [ { "expression": [ { "type": "property", "key": "account_id", "value": "123456789" } ] }, { "expression": [ { "type": "property", "key": "account_id", "value": "987654321" } ] }, { "expression": [ { "type": "property", "key": "account_id", "value": "918273645" } ] } ], "tags": [ { "key": "Vertical", "value": "Fintech" } ] }
2. Updating the tag logic
Adding more accounts to an existing tag mapping entails using the Add Metrics to Tags API. Here is an example of how to update the #Vertical=Fintech tag with an additional account.
{ "expressions": [ { "expression": [ { "type": "property", "key": "account_id", "value": "192837465" } ] } ], "tags": [ { "key": "Vertical", "value": "Fintech" } ] }
In case you need to remove customer account IDs from an existing tag, follow these steps, to override the existing mapping
a. (Optional) Fetch the relevant tag ID and its mapping using the Get Tag by Search Expression API
b. Delete the existing tag ID using the Delete Tags API
c. Recreate the new tag logic with the updated mapping using the procedure described in (1) above.