I’m trying to figure out how to monitor what users are doing when they edit Google Docs files. I want to capture specific information like when someone adds text, deletes content, or makes formatting changes. The main goal is to create daily reports showing what each person changed in the document.
I’ve been looking through the Google Drive API documentation but haven’t found exactly what I need. There’s something called the Drive Activity API that might work, but I’m not sure if it gives me the detailed change tracking I’m looking for.
If the API approach doesn’t work out, I was thinking about embedding the Google Doc in an iframe on my website and trying to capture user interactions that way. Has anyone tried something like this before? What would be the best approach to track document modifications?
honestly, google docs’ revision history might be all u need. it tracks every change with timestamps and shows who made what edits. plus u can pull that data through their api if needed. way easier than trying to capture edits in real-time.
The Google Workspace Admin SDK Reports API is worth checking out if you’ve got admin access. I used it to track document activity across our org and it gives decent audit trails for file changes. But for granular stuff like specific text edits, you’ll need to mix approaches. I ended up using the Drive API’s revisions endpoint to compare document versions programmatically. You’ll have to diff the content between revisions yourself, but it gives you the detailed change info you want. Set up automated revision snapshots at regular intervals so you can piece together what happened between versions. Not perfect but it works for those daily reports you mentioned.
I built something like this for our team a few months back. Go with the Drive Activity API - it’s your best bet, though it has limits. You won’t get character-by-character changes, but you’ll see when edits happen, who made them, and timestamps. That iframe idea won’t work. Google Docs runs in a sandbox that blocks you from tracking detailed interactions because of cross-origin restrictions. I ran into the same wall. Want more detailed tracking? Try Google Apps Script with the Document service. You can set up triggers that fire when people edit, which gives you better insight into actual content changes. Takes more setup though.