NOTE: A new version of Dwarf Fortress was released. It's entirely possible that some or all of the underlying information is no longer accurate in newer releases. I'll update this once there's a sufficiently stable version to play and test things.
If there's any path into your Fort, the goblins will take it -- no matter how many traps are in their way. However, if there's no path because you locked down the gates when they showed up, they just wait outside until your dorfs starve.
What's always worked best for me is a couple of winding one-tile-wide corridors with doors and traps to
murderentertain your "guests" to the side of the main entrance which closes by floodgate whenever you pull the "We've got invaders" lever.
Also, any creature with the "Building Destroyer" flag set (Trolls, for instance) will make a beeline for any construction they see -- such as statues, conveniently placed outside your fortress to better display your puissance -- and never mind the stabby traps surrounding it.
In general, the explanations listed here in the Dwarf Fortress Wiki help a great deal; the only thing I'll add is that a trap that kills an enemy has a corpse stuck in its teeth and needs to be cleaned out before it can kill again (generating "Clean Trap" jobs for your dorfs in the exact time and place you do not want your dorfs to go at that point), while a trap that merely maims an enemy is free to maim the next enemy that comes along a minute later without problem. A long line of single-weapon traps will generally outperform a single trap with ten weapons in it -- although it does mean you'll be cleaning goblin and troll blood and guts off the walls for a couple of months...