Working with the Do Not Track header is fairly easy on a technical level. In these tutorials we provide a sample code to get you up and running quickly. You can download this sample code from Mozilla at http://dnt.mozilla.org.
- Tutorial 1: Reading the DNT header is the “Hello, World” for DNT. We show you how to read a DNT header from website visitors, and how to pop up an alert to display the value of that header.
- Tutorial 2: Displaying DNT status with caching moves beyond a quick alert and instead displays an image that changes based on the user’s DNT settings. This is something you might use in practice to communicate with your site’s visitors. We introduce one bit of complexity: how to handle the possibility that users changed their DNT status after caching one of the images.
- Tutorial 3: Collecting aggregate data based on DNT illustrates how you could aggregate user data, or delete cookie data and expire cookies.
Previous section: Case studies
Next section: Additional resources