why not use the original (haml-side) check?

-if current_user
  ga('set', 'dimension1', 'signed_in');