# Path: resources/lib/compat.py



    from urllib.request import urlopen, build_opener, install_opener, Request, HTTPSHandler, URLError, HTTPError
    from urllib2 import urlopen, build_opener, install_opener, Request, HTTPSHandler, URLError, HTTPError
    from urllib.parse import urlencode
    from urllib import urlencode
from resources.lib.compat import itername, compat_unicode, compat_basestring
import random
import datetime
import time
import uuid
import hashlib
import socket




class Tracker(object):
    """ Primary tracking interface for Universal Analytics """
    params = None
    parameter_alias = {}
    valid_hittypes = ('pageview', 'event', 'social', 'screenview', 'transaction', 'item', 'exception', 'timing')


    @classmethod
    def alias(cls, typemap, base, *names):
        """ Declare an alternate (humane) name for a measurement protocol parameter """
        cls.parameter_alias[ base ] = (typemap, base)
        for i in names:
            cls.parameter_alias[ i ] = (typemap, base)

    @classmethod
    def coerceParameter(cls, name, value = None):
        if isinstance(name, compat_basestring) and name[0] == '&':
            return name[1:], str(value)
        elif name in cls.parameter_alias:
            typecast, param_name = cls.parameter_alias.get(name)
            return param_name, typecast(value)
        else:
            raise KeyError('Parameter "{0}" is not recognized'.format(name))


    def payload(self, data):

# Path: resources/lib/compat.py



# Path: resources/lib/UniversalAnalytics/Tracker.py
    from urllib.request import urlopen, build_opener, install_opener, Request, HTTPSHandler, URLError, HTTPError
    from urllib2 import urlopen, build_opener, install_opener, Request, HTTPSHandler, URLError, HTTPError
    from urllib.parse import urlencode
    from urllib import urlencode
from resources.lib.compat import itername, compat_unicode, compat_basestring
import random
import datetime
import time
import uuid
import hashlib
import socket





class Tracker(object):
    """ Primary tracking interface for Universal Analytics """
    params = None
    parameter_alias = {}
    valid_hittypes = ('pageview', 'event', 'social', 'screenview', 'transaction', 'item', 'exception', 'timing')


    @classmethod
    def alias(cls, typemap, base, *names):
        """ Declare an alternate (humane) name for a measurement protocol parameter """
        cls.parameter_alias[ base ] = (typemap, base)
        for i in names:
            cls.parameter_alias[ i ] = (typemap, base)

    @classmethod
    def coerceParameter(cls, name, value = None):
        if isinstance(name, compat_basestring) and name[0] == '&':
            return name[1:], str(value)
        elif name in cls.parameter_alias:
            typecast, param_name = cls.parameter_alias.get(name)
            return param_name, typecast(value)
        else:
            raise KeyError('Parameter "{0}" is not recognized'.format(name))


    def payload(self, data):

        for key, value in getattr(data, itername)():