The government bought ads on Facebook, Twitter, Google and LinkedIn before Brexit vote was cancelled.