def gaq_setup(request, account_id, single_push=False):
    """Sets up request.tmpl_context._gaq dict which we use for storage.
    
        You'd probably have something like this in your base controller:
        
        class Handler(object):
            def __init__(self,request):
                self.request = request
                h.gaq_setup(self.request,'AccountId')
                
        All of the other commands in the module accept an optional 'request' kwarg. 
        
        If no 'request' is submitted, it will call pyramid.threadlocal.get_current_request()
        
        This should allow you to easily and cleanly call this within templates, and not just handler methods.

    """
    request.tmpl_context._gaq = {'__singlePush': single_push, '_setAccount':
        account_id, '_setCustomVar': [], '_setDomainName': False,
        '_setAllowLinker': False, '_addTrans': [], '_addItem': [],
        '_trackTrans': False, '_trackEvent': []}
