Building realtime maps

We’ve wanted to build realtime maps of where ads are being targeted for a long time. Ideally, we want to combine that with data about how much is being spent in particular places, and being able to show the political competition underway there.

In 2024, we had our first go at doing that, where we took the targeting information we could gather from the Meta Ad Library, across hundreds or thousands of pages we’ve classified by political party, and mapped it all out.

Here’s what that looks like for the UK:

The idea is that, for any given date range, for a campaign, you can see:

  • Who is advertising in which places (e.g. where you live) and spending the most (the predominant colour, with darker = more money)
  • Which are the most interesting constituencies/districts/counties to explore (e.g. swing seats/districts)
  • What each party is doing individually (i.e. as a single layer of the map) or versus its key opponents (by turning on a second or more layers)
  • Some other electoral data (in the UK’s case, the incumbent, their margin of victory at the last election and the candidates standing).

Here’s what that looked like in the US:

As you can see, the swing states stand out pretty clearly as „blue“ (as in the Harris campaign and its affiliates spent way more than Trump and the Republicans). Looking at how the map changed over time, it became clear how Trump’s spending came later, with the Dems largely unopposed in the swing states until the final week – a red surge (though it still didn’t topple what the Democrats were doing). A map feels like one of the most intuitive ways of displaying this shift.

Why do maps of ads matter?

In most countries, but particularly in those with an electoral system where geography is really important, being able to visualise where effort is being made (versus not) shows where the campaign is happening. Pointing to data that says „they are trying hard to win here, and are running these sorts of messages in that place“ and „they don’t seem that bothered about this place“ matters, both in terms of showing how many voters are de facto disenfranchised by increasingly precise, scientific campaigning, but also as a way of understanding how a campaign is unfolding.

Traditional political journalism typically follows a physical campaign day to day as it rallies, speaks and buses itself around. Data journalism sometimes maps those visits in the expectation it will expose who and where the key swing voters are. Realtime information about where money is being spent on digital ads doubles down on that. It helps to expose the inner workings and thinking of a political campaign – what is their research telling them? Who do they think is important?

A note on the practicalities of doing this

Building the maps was HARD. It took a lot of data gathering, processing, interpretation and database power. The servers to run them are expensive (around $500 USD a month for a service called ClickHouse) and, as a result, we’ve made the decision to take them down. It’s not what we want to do, but $6000 a year just for hosting, plus a fair amount of development time to keep things going, is just too much (though we are looking for solutions for the forthcoming Australian and Canadian elections, both of which we feel would benefit from mapping).

Furthermore, rather than giving up on the idea, in the future, we want to take it further and build maps that go beyond spending patterns, looking at the way certain demographics are being targeted or issues being raised or ignored in particular places.

If you think a map like the ones above would be useful where you are, please get in touch.