Yes. using a black light will help you find traces of urine on the carpet cats will usually spray along the walls and dog urine will usually be found near the center of the room. Male dogs will mark corners of door jams and corners so check them as well.
If it is dog body odor hire a Truckmounted carpet cleaner these units have high heat to break down the body oils transferred from dogs to the carpet.
If it is pet urine check out www.thepetodorspecialist.com