Over the past years Facebook have had a few privacy related issues. First came the ‘scandal’ with Cambridge Analytica and more recently a bug (or series of bugs) that apparently affected 50 million accounts allowing peoples access tokens to be stolen. Oh, and there was also the story about Facebook using your 2 factor authentication phone number for targeting advertising.

With all of the goings on recently, as well as the new GDPR (General Data Protection Regulation) in the EU, Facebook have attempted to make the data that they have about an individual easier to see, understand and edit or remove. One such section of this data covers your “ad preferences“.

Screenshot of Facebook ad preferences

What is actually included here?

Starting at the bottom, there are three pretty fine grained tabs “Hide ad topics”, “Ad settings” and “Your information” that provide you with some control controls and in theory limit some of the data that Facebook will use while targeting.

The top two sections are far more general and contain multiple categories and elements within the categories. “Your interests” includes various interests that Facebook has decided that you have and should be targeting using. “Advertisers you’ve interacted with” shows any interaction with advertisers, including website visits, advert clicks, and advertisers manually adding your contact details it would seem.

Having a little scroll through all of the information here can be quite interesting. I struggle to see how Facebook has made some of the links that it has recorded here for my account, but I have been using Facebook for many years. What on earth is “The Suburban Collection” and why am I apparently interested in it?

Usability for removal

The two larger sections definitely look nice, but are they really that useable? No not really.

My interests section is split over 10 separate categories, each with their own tab for access. Each tab also does not display all interests at once, instead the user is forced to repeatedly click the “See more” link and scroll down the page, tens or hundreds of times. And then I have to target a small X in the top right of each interest box to remove it. No, there is no select all. At least there is no confirmation… It’s almost like Facebook doesn’t want to make removing this stuff easy.

A little bit of JavaScript

I figured rather than spending my time clicking on the thousands of elements that I would need to in order to removal all interests and advertisers that I have interacted with I would knock up a little bit of JavaScript.

I worked on a few different iterations but didn’t want to spend too much time on the problem so I ended up with the small functions below.

NOTE: Please only run this code if you know what you are doing / understand the code below. This code is licenced with the Unlicense.

This can be directly copy and pasted into the developer console while browsing the “Ads interests” page. Then to run one iteration of the code that will click on “See more” once, followed by clicking on all “Remove” buttons currently visible just run the  seeMoreAndClickXs() function with the following:

Of course you will probably have to run this function multiple times. If you run it and still see the “See more” link at the bottom of the section, then run it again!

Whats next?

Of course the developer console is going to warn you about the possibility of XSS attacks. Running things like this in the developer console isn’t ideal for the masses. Please only do things your comfortable with, give https://www.facebook.com/selfxss a read. Maybe I should turn this into a browser extension…

Ideally Facebook would just make their UX a little better. Why isn’t there just a “Remove all” button?

It would also be nice if this could be a single click thing, rather than having to run this function multiple times. But I couldn’t really get that done in the 15 minutes I dedicated to this task.

Interestingly although all of these interests are “Removed”, facebook still has this data about you, as it continues to list all of the removed interests. I wonder if they go away after a period of time? I imagine not. I wonder if GDPR allows for requests for specific information like this to be removed?

I also have no idea if Facebook was actually using this data in the first place, given my “Ad settings” specify that various types of Ads are already not allowed.