Custom Validations - How to create a trigger
The different ways you can create a trigger
Table of Contents
Prerequisites
- Assertion Hub QA Account. You can create it for Free
How to create a Trigger?
There are 2 ways to create a trigger:
- Create a trigger from scratch
- Create a trigger from “an existing request”
Create a trigger from scratch
- Click on “Entities” in the navbar. Here you will see all your tests and triggers.
- To create a new triger click on the button “Create Trigger”
- Select the vendor this trigger should check (e.g. GA4, Google Tag Manager, etc…)
- Ensure under Select Creation Mode you have “Create Trigger only”
- Give a name and description to your trigger and select the Logical Operator. This will adjust the check on metrics, “OR” means if any of the selected metrics evaluates to true and “AND” means all the selected metrics have to evaluate to true
- Click on add metric and write in the Metric Path. You can use as trigger a metric in an object like pr1.item_name or the object itself or a normal metric like “en” for GA4 event name.
- Once you’re done with the metrics you can decide to associate this trigger to a test. Which means: IF the trigger metrics conditions will evaluate to true, then fire the associated tests
- Click on Create Trigger
Create Trigger from request
- When you run a Validation using our AH Debugger extension, you will see the collected requests in Assertionhub QA. To know more about your first Validation. Click here
- If you click on a request, you will see a button bottom-left with “Create Test from Request”
- Once you click it you will see a prefilled “Create Entity” Panel with the vendor already chosen and all the metrics belonging to that request for you to choose which one to validate.
- You can, in one shot, create a trigger and a test at the same time. For this guide we’ll create just a trigger then under “select creation mode select “create trigger only”
- After you name your Trigger and give a description if needed, select the Logical Operator. This will adjust the check on metrics, “OR” means if any of the selected metrics evaluates to true and “AND” means all the selected metrics have to evaluate to true
- Now you can select the trigger metrics. Once you choose a metric you want to use in your trigger, tick the box under the last column on the right “Trigger”
- You can use as metric any type of metric. A specific event parameter inside the object or even the object itself
- Once you’re done with the metrics you can decide to associate this trigger to a test. Which means: IF the trigger metrics conditions will evaluate to true, then fire the associated tests
- Click on Create Trigger