from datetime import datetime


def convert_ga_timestamp(timestamp_string):
    """Convert google analytics timestamp in datetime object."""
    timestamp = float(timestamp_string)
    if timestamp > ((2 ** 31) - 1):
        timestamp /= 1000
    return datetime.utcfromtimestamp(timestamp)