Spent weeks with ours training her to ride with me.
Was lucky in that ours will do anything for food.
Found a seldom used path. Road with the dog on my left with food in my hand at walking pace saying ‘heal’. She now knows ‘heal’ is to get on my left at or around my back wheel regardless if we are stopped or moving.
Then the ‘back’ command which was a bit more awkward. Similar process but to get her to run behind me when we are moving.
We have a release command, ‘go on’, which means she can go like the clappers in front of me. That was taught off the bike while throwing sticks. She will heal until we give her the release command.
Basically, practise, praise, treats (damn it, wanted another P)