Adobe's Product dimension is very powerful, but also one of the more complex topics within the Adobe architecture:
https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/products.html?lang=en
For each product passed, you can have specific merchandising events and evars stitched only to the relevant product...
So let's say you have a product list page, maybe you want to list ALL products on this page, with say a "product list view" custom event (event1), and maybe you want to track "in stock" or "out of stock" as a merchandising eVar (evar1)
The format for each product is:
category;product identifier;quantity;price;merchandising events;merchandising eVars
We don't need price or quantity at this stage, and let's just ignore category for the moment
You would want to configure an event for your "product list view" custom event (event1), and also set up an eVar as a merchandising eVar with "Product Notation"
Now you would pass all product on the page like:
s.events="event1";
s.products=";pro-1;;;;eVar1=in-stock,;pro-2;;;;eVar1=out-of-stock,;pro-3;;;;eVar1=in-stock"
This will result in each product counting "product list view" once (in context) but at a whole level, you will see 3 impressions in total (for three products being seen on the page)...
pro-1 and pro-3 will correlate to eVar1 with the value of "in-stock" and pro-2 will correlate to "out-of-stock"
IF you need to apply events separately to each product, then you can create a counter event and pass inside the products notation as (event2=1), but for this you shouldn't need it.... however, if you say have a product detail page with "a section of similar products, you might want a custom event for "main product detail page" (event2) vs an event for "similar items on detail page" (event3) - then pass ALL products in the list, but only apply event2 to the main item, and event3 to the other products (event2 and 3 will need to be configured as "numeric" events, as opposed to the default "counter" events):
s.events="event2,event3";
s.products=";pro-1;;;event2=1;eVar1=in-stock,;pro-2;;;event3=1;eVar1=out-of-stock,;pro-3;;;event3=1;eVar1=in-stock"
Now, on the compare page, you can do the same, passing the products that are being compared, but instead of event1, you would create a new event2 "product compare" (changing all instances above from event1 to event2) - you may or may not need to know in-stock vs out-of-stock in this context, that is up to you... maybe there are other things you want to track that would be passed in their own merchandising eVars.
When adding products to the cart, you can do something like:
s.events="scAdd";
s.products=";pro-1;;;;eVarX=something|eVarY=something-else";
Odds are products will be added one at a time, so only one will be in each call (unless you have an add all to cart, which is possible)... The "scAdd" is a reserved "add to cart" events.
There is also a start checkout event that you can use (scCheckout), and on purchase success, you can use the "purchase" event, and now you can make use of the quantity and price areas of the products to pass in the values.... the price should be the price of each product... Adobe should take the quantity purchases and multiply it by the price to add that total to the revenue metric.