We also had that problem when our Zuzi was about 4-6 months baby. We patiently explained to her that this is a bad thing in a way that she understands she has done something wrong.
With the time (probably a month or two) she stopped doing that and never saw her again doing it.
Now she has another favorite thing - we were hiking on Saturday and I turned back to see if Zuzi is following me. Then I saw her rolling over a caw poop

Thank God it was kind of old