No super secret that I know of but here are a few hints
There is a special foot for SID for some machines. It has a metal guide that runs in front of the foot that sits in the ditch so your needle will go in the ditch.
If you don't have the SID foot try slowing down a bit. I find that if I spread the fabric as much as I can with my hands before it goes under the needle as I the quilt feeds under the walking foot that seems to help keep my stitches in the ditch.
I have done many where I purposely stitched right next to the ditch, like 1/8" or less and used the seam as my guide.