Note that scriptDB has been deprecated. I leave this article here for interest.
In Using scriptDB, I covered some usages of scriptDB,along with a method of siloing data to keep it organized. Since scriptDb gives the possibility of shared persistent storage here's a usage that might be useful for tracking things.
In Apps Script timer collection i covered how to measure how long certain activities took, but that was mainly for performance tuning. If you want to track activities, then you need some kind of persistent storage accessible from multiple places. You could for example, track who is opening what workbook.
Using the idea of siloing the scriptDB, we can set aside a slice of it to track when certain events start and finish using Google Apps Script. Here's an example of logging a couple of events, and how long it took.
We can report on tracking activity easily like this, to a worksheet named 'logger' function
that gives us this output
Similarily, clearing out all tracking data is straightforward.
One of the advantages that scriptDB gives us is that we can access the same db from multiple places. In the example, we use a function
However, much more usefully, you can use a shared DB by creating a script library , lets call it myLibrary, and create getPrivateDb() there. By adding a reference to myLibrary in each of your spreadsheets, you can get access to the same scriptDb. I recommend you create a getPrivateDb() in each spreadsheet script, which return the DB of a shared scriptDB as follows.
All shared code can be found in the mcpher google apps script library which is publicly available as follows
Project Key : MEQ3tE5y5_cTOAgUbUKSIAiz3TLx7pV4j
Source code: https://script.google.com/d/1hhJ8M6z99XccL8WRq2d24-pWGwhq8EfYNaQIQV0CEe5gE1HbBoF4X9W_/edit
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > From VBA to Google Apps Script >