A document tracking method, a gateway device, and a server, where the gateway device intercepts a first data flow from a first terminal device in an internal network to a second terminal device in an external network, inserts a first Uniform Resource Locator (URL) into a first document in the first data flow to obtain a second data flow that includes a second document, and sends the second data flow to the second terminal device.