If your dog has no history of doing this and then just starts eating poop I would definitely suggest you get medical help asap to see what is going on from a health standpoint with your dog.
More often than not, dogs are just copying the behavior of their mothers while they were young. Puppies are curious and often copy their mother actions -
eating feces
is just one of these actions that they may learn from their mom.
Also, if left to grow up in a dirty cage or run or any area where poop is not cleaned quickly, a bored puppy may revert to poop eating just out of sheer boredom.
Early prevention is often the best thing to keep this behavior from becoming a habit. Prevent your
German Shepherd puppy from eating poop by
cleaning all fecal material quickly and often. It is much easier to prevent a habit from happening in the beginning than from retraining a dog to not do a bad habit after it has become ingrained in their behavior.
After all, in this case, if there's no poop to eat then there's no problem. Prevention is key. Intestinal parasites can easily be transferred from the host animal to yours particularly in this case. It is very important to make sure that your dog should be on a very rigid worming schedule if he has the coprophagia habit.
Remember to
scoop your poop
and dispose of it appropriately and you'll cut down on the chances of your pet participating in this act in the first place.