Is my new door closer broken because there is noise coming out when shaking the door closer?

No, the door closer is fine, It's normal to hear some noise when shaking the door closer by hand. 

There is a short spring inside acting as a shock absorber to prevent the door closer from over extended. 

This spring would slide back and forth along the rod when shaking the door closer, hence the noise coming out from the door closer.