Many ships, and certainly all large oceangoing vessels, transmit both course over ground (direction of motion) and heading (direction the bow is pointed). Sites like MarineTraffic and VesselFinder use the heading to draw the vessels on the map in the correct orientation, but in the vessel details they only display the course over ground as far as I can see.
Inland-only vessels don't always have a gyrocompass or GPS compass, or don't have it connected to the AIS transponder, in which cases they only transmit course over ground and not their heading.
Inland-only vessels don't always have a gyrocompass or GPS compass, or don't have it connected to the AIS transponder, in which cases they only transmit course over ground and not their heading.