Our tank is up against a building, whose face is part of the "paddock". I have the tank flush to the wall, and because its a 150 gallon tank, they don't bother reaching to the back of it/to the wall to where the outlet is. The outlet is an outdoor GFCI type outlet.
Directly behind the tank, is the ground rod so its not out where the horses can of course cause damage to themselves with it, as horses will always do!
Wire clamped to ground rod, then, up over the side of the tank (I bent it to "squeeze" the side of the tank so it doesn't move around) and then the end right into the water, and is long enough so the wire goes to the bottom of the tank (so I don't risk the water level getting lower than the wire).
I have the wire going in more to the side, just so the wire isn't touching the heating element itself. I'm not sure that it would matter, but thats the way I chose to keep them separate.