I believe this is a highly important and useful feature that has been requested for a long time. As has been pointed out before, there is no official solution. While hints to the correct answers haven been provided here and here before, there is still no step-by-step tutorial on the most flexible solutions for tagging transactions in GnuCash:
The the easiest/best two options seem to be:
- Using "dimension" (or analytical) accounts
One easy and clean option is described here and involves adding new "dimension" (or analytical) accounts (holding your projects/events/person etc., eg holiday2022), and then tagging transactions by adding a new $0-split pointing to the specific dimension account (eg holiday2022):
The current work-around I am using is to create my dimensions has a bunch of accounts under a new high-level structure (Dimensions for instance). Then I create a sub-account for each type of dimension Departments, Projects, Events, etc). Finally under each sub-account I create sub-accounts for each actual dimension. These accounts will never have any money in them so they will not interfere with the real GL accounts. Instead, I simply use them to add additional splits pointing to the dimension accounts (with no amount) to any GL transaction I want to tag.
To generate reports: Briefly, use the "Transaction Report": Under the "Accounts" tab, select the accounts of interest except the specific dimension account. On the same tab, right below, select the filter type "Include Transactions to/from Filter accounts" and then select the specific dimension (project/event/person etc -eg holiday2022) you are interested in. Now you will get a report of all transactions tagged with the specific dimension.
- Using label tags
Just add a label tag, such as #tag, to the transaction description, memo or description of the split. To generate a report,
again use the "Transaction Report": Under the "Accounts" tab, select the accounts of interest. On the "Filter" tab, enter the tag name, eg #tag, in the field "Transaction filter". Now you will get a report of all transactions tagged with the specific label.
Date- and source-based solutions
Other solutions such as custom reports by date or by source account are not useful in case you need a detailed, granular report as opposed to an all-or-nothing approach.
Method 2 seems quicker and fitter in case you are also collecting data on a mobile device. The biggest advantage compared to method 1 is, you can tag specific splits of one transaction (View > Transaction Journal), giving you even more detail and flexibility. Compared to 1, you will, however, not get a list of all your projects/events etc. you are tracking, and spelling mistakes might cause errors in your analysis (eg #tag1 vs #Tag1, there are workarounds for this though, using the RegEx and case-insensitive report options).