We present a detailed analysis of the relationship between the infection rate by SARS-CoV-2 and a distancing index based on COVID-19 Community Mobility Report by Google, for all states in the United States and Brazil, its most populous counties and municipalities, respectively, and all the 22 European Economic Community countries and the United Kingdom, with Google data and at least one thousand deaths by COVID-19 in 2020. We discuss why the infection rate is a proper choice to perform this analysis when analyzing a wide span of time. A strong Spearman's rank order correlation between the social distancing index and the infection rate in each locality. As a side result, we show that mask mandates increase the values of Spearman's correlation in the United States, where a mandate was not universally adopted. We also obtain a numerical relationship between the infection rate and the social distancing metric introduced in the present work.