Change a variable dynamically without it persisting in the DB
So this is what I came up with, an implementation of hook_init(). Perhaps there is a better solution?

function MYMODULE_init() {
  global $conf;

  // If we have the environmental variable ENV &amp;&amp; we are not on a config page
  if ($env = getenv('ENV') &amp;&amp; current_path() != 'admin/config/system/googleanalytics') {

    // Alter the googleanalytics_account ID
    if ($env == 'dev') {
      $conf['googleanalytics_account'] = 'UA-xxxxxxxx-x';
    }
  }
}