def index(self): ga = FlaskGATracker('www.codingexcuses.com', 'UA-53020725-1') for method in self.accepts: if self._accepts(method): response, path = Which( method, request.args ).get_response() ga.track(request, session, path=path) return response # Assume it's a browser response, path = Which("text/html", request.args).get_response() ga.track(request, session, path=path) return response
def google_track(): if config.analytics_enabled: tracker = FlaskGATracker(config.analytics_account, config.analytics_domain) tracker.track(request, session, str(session['userId']))