Hedgehog behaviour

I posted this under forums and here's a photo of what the hedgehog leaves behind. Two hedgehogs visit my garden every night. One of them just comes in for the food through a hole in the fence but the other one hangs around in the garden and has a peculiar habit of walking backwards and forwards in front of the back gate for minutes at a time. This leaves a brown stain or trail on the paving stones by the gate. It also poos by the gate. Is it marking its territory?
Anonymous