Editing time for pages in google analytics? I've been asked for "development/editing" time for pages analytics to be made available.

Is this possible? If so, how?
Ok - you want to use Google Analytics custom variables for this and a bit of javascript (though will try and make this as Drupaly as possible). For the timer, you can write javascript/jQuery code to start a timer on the window.load() event and then attach it to the submit button on your particular form. Number of examples of javascript timers, I found this example that looked promising.

Key thing to get this data to your google analytics account is to add a google analytics push event (see documentation above) so your code would look something like this (rough psuedo code)

$(document).ready(function() {

   function StartTimer() { some timer function ... }

   function StopTimer() { some timer stop function ... return $time; } 

   startTimer();

   $("#id-for-form-submit-button").click(
       $timeValue = StopTimer();
       _gaq.push(['_setCustomVar',
          1, // This custom var is set to slot #1.  Required parameter.
          'Editor Time', // Category Name. Required Parameter
          $timeValue,  // This value of the custom variable.  Required.
          3  // Sets the scope to page-level.  Optional parameter.
      ]);

});


Finally, you need to attach your javascript to your form (the drupaly part). I use this quick code snippet (from switchbackcms) as a good way to avoid losing the javascript if the user reloads the form:

function hook_form_alter(&amp;$form, $form_state, $form_id){
  if($form_id == 'form_in_question'){
     $form['some_element']['#after_build'] = array('_load_my_javascript);
   }
}

function _load_my_javascript($element){
    drupal_add_js(
      drupal_get_path('module', 'my_module') 
        . '/track_editors.js');
return($element);
}