Is hook_file_download the right hook for taking action when a private file is downloaded? I'm trying to create a module that will fire send an event via google analytics' Measurement Protocol API when a file is downloaded.  These files are all in the private file system outside of the document root.

hook_file_download looks like a somewhat likely candidate for triggering an http request to google analytics, but since the hook is responsible for access, it seems possible that another module might deny access after this version of the hook is run, and google analytics would get an event even in cases where the download didn't go through.  If there a better hook that would be run after all the access check have finished?  I should probably mention that I am using the media module.

Supplementarily, the existence of both hook_file_download and hook_file_download_access is confusing since they both claim to control access to files.  Is it a correct understanding that hook_file_download_access basically controls whether a user has access in relation to the entity the file is attached to (so likely would control whether the download link is displayed at all or not), and hook_file_download only applies to private files, and checks on access after a request for the file has been made?

Follow Up

I ended up implementing two hooks: hook_file_download and hood_file_transfer which as far as I could tell is undocumented in the drupal api site as a hook.  Both of those hooks calls a function passing the $uri parameter which in turn builds the google analytics request and then sends an http request.  That seems to cover the two different cases when a file download passes through drupal for my setup.
If I recall correctly, there's an access pass before hook_file_download is ever called. hook_file_download is called so you can modify headers, or do a last minute abort on the download.

So on the assumption that no one else is calling that hook (which you should check for the modules you have installed), a hook_file_download implementation is a perfectly fine place to do something like call a Google API. The only caveat is that if you're calling a web service, you want to make sure it doesn't take so long as to screw up the download.

I'm fairly certain that the hook will be called for any file scheme (i.e., "private:", or a custom scheme).  You may want to look at the Drupal 7 Example module "File" example, which I believe shows a hook_file_download implementation.

The behavior in Drupal 8 is similar, BTW.