So, assuming bash is your shell, the ~/.bash_profile is executed for login shells for the user logging in.
~/.bashrc is the initialization script for when starting a bash session (for the current user).
In my experience, the ~/.bashrc will also execute ~/.bash_profile if it exists. So you can use either.
I dunno. Kernels can dump the memory pages and whatnot, surely they could throw in which ad got served at the time too. I’m sure someone up at Microsoft is smart enough to figure it out.