I would also say that D. to obtain identification cues and other information is the correct answer here.
When dogs investigate other dogs' feces and urine, they do that for the same reason why we might browse through a person's Facebook profile - they want to see what kind of a dog was there and to gather data on the canines who live in or pass through that area.