You run faster than the anky, so you do not need to make a trap for it, unless it is a lot if wild dinos around you.
Ankylosaurus
The Ankylosaurus is a heavily armored herbivore specializing in harvesting metal and other mineral resources. Its durable body and crushing tail make it a sturdy, if slow, defensive mount.

How to survive, fight, and kill a wild Ankylosaurus, from players who have done it.