I agree that what you need is an enzymatic cleaner that will literally eat away the cause of the smell. The two listed by the previous poster are good, as is Odo-Ban. It's good for your laundry,too. I get it at Sam's, but I'm sure it's other places, too.
I would recommend spraying it on (whichever one you buy) and let it sit over night. Then spray some more (or some water... something to wet it lightly again) and use a carpet cleaner on it. You can rent a Rug Doctor (the best for pulling out liquids) or buy a Bissell spot-bot. It's kinda expensive (about $100) but we've used it so many times to clean things up from the carpet, it's paid for itself (if you consider that we would have had to rent something all those times). You want to buy the one from Target, not the one at Walmart... they look the same, but the model number is slightly different and the one from Walmart has a less powerful motor (I did my research before I bought mine). It costs $10 more at Target, but the stronger motor is worth it.
You want to get your carpet really dry and a strong motor is important for that. Also, repeatedly spraying it very lightly with the enzymatic cleaner is better than trying to soak it. If you get the pad below the carpet too wet, it's too hard to dry and you might introduce a mildew problem in place your current issue.
Best of luck!
P.