Other folks dogs? If so a fence could work or a motion sensored sprinklers.
walking more maybe? or a doggy litter tray lol :)
Agree with top comment if other dogs ... Hope someting works for you
At least they are not pooping in your yard like they do on my yard..wish I had a solution for that!!