My dog used to do this all the time and it is gross. I think it has something to do with a dog's keen sense of smell. They are very attracted to the scent. What I did, is buy one of those garbage cans with a lid on it. My dog couldn't get in it.