Harvard grad student (?), Seth Stephens-Davidowitz, studies Google searches for racial epithets 2004-2007 to control for reverse causation. He used this to define an area’s racism. He finds:

Racially charged search rate is a significant, negative predictor of Obama’s 2008 and
2012 vote shares, controlling for Kerry’s 2004 vote share. The result is robust to controls
for changes in unemployment rates; home-state candidate preference; Census division fixed
effects; demographic controls; and long-term trends in Democratic voting….

The preferred point estimates imply that, relative to the most racially tolerant areas in
the United States, prejudice cost Obama 4.2 percentage points of the national popular vote
in 2008 and 4.0 percentage points in 2012. These numbers imply that, among white voters
who would have supported a white Democratic presidential candidate in 2008 (2012), 9.1
(9.5) percent did not support a black Democratic presidential candidate.