Data a website records about every visitor

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Data a website records about every visitor

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A student visits a school website and only reads the home page without typing anything. Does the web server still record the visit?
A Yes, the server writes a log entry for the visit
B No, it only records things the visitor types in
2. Which item is usually found in a server log entry?
A The visitor's IP address
B The visitor's private messages to friends
3. Which one is a passive digital footprint?
A Posting a photo with your name on a public profile
B A server log recording your IP address when you load a page
4. A log entry says: 'Mobile phone, Chrome browser'. What type of detail is this?
A The visitor's password
B Browser and device type
5. A log entry says: '3:42 pm, /sports.html'. What two things does it show?
A The time of the visit and the page visited
B The visitor's name and home address

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1203.0.113.42 - - [12/Mar/2026:09:15:02] "GET /home" AA log entry also records the IP address, the browser and device type, and the time of the visit.
2User-Agent: Mozilla/5.0 (iPhone; Safari) BThe browser and device type that the visitor's device tells the server, which is recorded in the log
3A log entry records which page a visitor viewed, even if they type nothing in CServers also log the IP address, device, time and pages for every visit, even when nothing is typed in.
4A log is a passive digital footprint because the visitor does not choose to create it DA server log entry showing the visitor's IP address, the time of the visit and the page requested
5No data is saved unless the visitor fills in a form. EGET /shop/shoes.html
6A server log only records the page name. F10.0.0.7 visited /news at 14:03

Definitions

server log

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
visit.__ = "203.0.113.5"
2.
visit.______ = "Chrome on Android"
3.
visit.____ = "2025-03-12 10:15:32"
4.
visit.____ = "/shop/shoes"
5.
server.___(visit) # even if nothing typed

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A entry = []
B entry["ip"] = "203.0.113.7"
C entry["page"] = "/home"
Question 2
A entry = {}
B entry["device"] = Chromebook
C print(entry)
Question 3
A log = []
B log.add("10:42 /shop")
C print(len(log))
Question 4
A visits = 0
B for page in pages:
C visits++
Question 5
A ip = 203.0.113.7
B time = "09:15"
C print(ip, time)

Answer Key

Data a website records about every visitor
Section A: Quick Questions
Q1
A — Yes, the server writes a log entry for the visit
Q2
A — The visitor's IP address
Q3
B — A server log recording your IP address when you load a page
Q4
B — Browser and device type
Q5
A — The time of the visit and the page visited
Section B: Match the Pairs
Q1
203.0.113.42 - - [12/Mar/2026:09:15:02] "GET /home" → A server log entry showing the visitor's IP address, the time of the visit and the page requested
Q2
User-Agent: Mozilla/5.0 (iPhone; Safari) → The browser and device type that the visitor's device tells the server, which is recorded in the log
Q3
A log entry records which page a visitor viewed, even if they type nothing in → GET /shop/shoes.html
Q4
A log is a passive digital footprint because the visitor does not choose to create it → 10.0.0.7 visited /news at 14:03
Q5
No data is saved unless the visitor fills in a form. → Servers also log the IP address, device, time and pages for every visit, even when nothing is typed in.
Q6
A server log only records the page name. → A log entry also records the IP address, the browser and device type, and the time of the visit.
Section C: Definitions
Q1
server log — A record a web server makes for every visit, such as the IP address, device type, time and pages viewed, even when the visitor types nothing in.
Section D: Fill in the Blanks
Q1
visit.ip = "203.0.113.5"
Q2
visit.device = "Chrome on Android"
Q3
visit.time = "2025-03-12 10:15:32"
Q4
visit.page = "/shop/shoes"
Q5
server.log(visit) # even if nothing typed
Section E: Spot the Error
Q1
A — A log entry with named fields like "ip" and "page" needs a dictionary, so it should be entry = {}. A list cannot use text keys.
Q2
B — The device type is text, so it needs quote marks: "Chromebook". Without quotes Python looks for a variable called Chromebook.
Q3
B — Lists do not have an add method. To put a new log entry (time and page visited) on the end of the list, use log.append(...).
Q4
C — Python has no ++ operator. To count each page view the server logs, write visits += 1.
Q5
A — An IP address has several dots, so it is not a number. Store it as text with quotes: ip = "203.0.113.7".