How to shoot campaigns for events in an e-commerce?

Hello everyone,

I am currently working on the development of an electronic commerce and I have connected Mautic with it so that, when filling out forms, users are registered in Mautic.

However, what I have not been able to understand is how to label or segment a user from an action carried out in the electronic commerce, which is not related to the filling of a form, such as: visiting a product category or adding certain products to the shopping cart.

So far I know that campaigns can be triggered after a user has been assigned to a segment, or when he/she has filled out a form, however, I don’t know how to trigger a campaign to a user already registered in Mautic previously, when he/she visits a category of products, add products to the cart or buy a particular product.

That is to say, the ideal would be that when performing any of these actions in the electronic commerce, thanks to the Mautic tracking code, a segment or a label should be assigned to the user, but I do not know how to assign the segment/label to an already registered user when said events are not related to the filling of a form, since these events can be presented at any time, without previously assessing whether or not it belongs to a segment, only by its own behavior in ecommerce.

Can anyone tell me how to do this?