Replacement Rear Shock

Is it advisable to replace a rear shock with an exact copy (albeit a newer and working version) as the factory supplied shock, or is it straight-forward enough to upgrade to a more expensive type of rear shock?
Specialized Rockhopper '07
Trek Fuel EX8 '09
Trek Fuel EX8 '09
0
Posts
Basically as long as the eye to eye and stroke lengths are the same it will work.
Some work better with certain frames though, and not necessarily the most expensive.
There is no secret ingredient - Kung Fu Panda
London Calling on Facebook
Parktools
and the tune of the shock too.
MTB Scotland youtube channel