if I add a new version of a site to netlify will I keep the analytics data?

Where are the analytics hosted and what do you mean a new version?

I have Google analytics script in the file. I'm going to deploy a new version of the website. I'm guessing the analytics will be fine because it's still the same domain.

If it's the same domain and same tracking code then it should work properly.