Your custom build cart can see if the URL contains an affiliate parameter or not. If it does, it can fill the promo code field for the user automatically.
Alternatively your cart could offer an option to send the promo code as it's own URL parameter. For example like this: &promo_code=1234 and when the visitor lands on your website with such parameter in his link your cart saves the field value in a cookie which will then populate the promo code field during the checkout automatically.
All this is cart functionality. It's not really related to our tracking software and it's tracking in any way.