The best way to implement custom variables with Google Analytics
"Custom variables" are now Custom dimensions and metrics.

The Google Analytics module supports custom dimensions and metrics.

See the module's README.txt:


  One example for custom dimensions tracking is the "User roles" tracking.
  
  
  In the Google Analytics Management Interface you need to setup Dimension #1    with name e.g. "User roles". This step is required. Do
  not miss it, please.
  Enter the below configuration data into the custom dimensions settings form    under admin/config/system/googleanalytics. You can
  also choose another index,    but keep it always in sync with the
  index used in step #1.
  
  Index: 1    Value: [current-user:role-names]