def _prefix_ga(value):
    """Prefix a string with 'ga:' if it is not already

    Sort values may be prefixed with '-' to indicate negative sort.

    >>> _prefix_ga('foo')
    'ga:foo'
    >>> _prefix_ga('ga:foo')
    'ga:foo'
    >>> _prefix_ga('-foo')
    '-ga:foo'
    >>> _prefix_ga('-ga:foo')
    '-ga:foo'
    """
    prefix = ''
    if value[0] == '-':
        value = value[1:]
        prefix = '-'
    if not value.startswith('ga:'):
        prefix += 'ga:'
    return prefix + value
