When you run the checkout wizard, there is a section for configuring how the order is stored in the database. This adds the eCart Store Order Summary and Store order Details server behaviors to the confirm page.
In your orders table, crate a column to hold the coupon code, in the store order summary server behavior, bind that column to the coupon code session variable.
in this way, when an order is placed, the coupon code will be stored in the database along with the other information about the order.
You can then query the orders table to return all of the coupon codes that have been used for tracking purposes. Exactly how that is done depends on *what* you are trying to track.