We consider a recent hierarchy of upper approximations proposed by Lasserre (arXiv:1907.097784, 2019) for the minimization of a polynomial f over a compact set K⊆ℝn. This hierarchy relies on using the push-forward measure of the Lebesgue measure on K by the polynomial f and involves univariate sums of squares of polynomials with growing degrees 2r. Hence it is weaker, but cheaper to compute, than an earlier hierarchy by Lasserre (SIAM Journal on Optimization 21(3), 864--885, 2011), which uses multivariate sums of squares. We show that this new hierarchy converges to the global minimum of f at a rate in O(log2r/r2) whenever K satisfies a mild geometric condition, which holds, e.g., for convex bodies. As an application this rate of convergence also applies to the stronger hierarchy based on multivariate sums of squares, which extends earlier convergence results to a wider class of compact sets. Furthermore, we show that our analysis is near-optimal by proving a lower bound on the convergence rate in Ω(1/r2) for a class of polynomials on K=[−1,1], obtained by exploiting a connection to orthogonal polynomials.