I’ve always used the Nature’s Miracle line from pet stores like Petco with some success. It seems to help for a time before the smell slowly returns (which it will if its in the carpet padding). They have solutions that you can manually work in or spray on as well as a solution for a carpet shampooer.
We have one incontinent cat and two others that cannot resist the urge to mark their territory where the incontinent cat has gone. Ugh! Smell city.
Like someone else wrote, we have also started replacing carpet with Pergo (although I would rate mine a 5 on her same scale) because once the urine gets into the padding it will not go away permanently. and if it hits your subfloor like it did for us in our dining room……yuck! the whole thing needs to be replaced to stop the odors.
in between quarterly treatments with the Nature’s Miracle, buy stock in fabreeze and use, use, use!