add google analytics

This commit is contained in:
hillerliao
2022-01-02 13:54:25 +08:00
parent 6f53552041
commit 7b015edb44
6 changed files with 393 additions and 257 deletions

View File

@@ -18,6 +18,14 @@ def create_app(config_name=None):
app.config.from_object(config[config_name])
app.response_class = XMLResponse
# Add analytics
from flask_analytics import Analytics
from rsshub.google_analytics import ga_account
Analytics(app)
app.config['ANALYTICS']['GOOGLE_CLASSIC_ANALYTICS']['ACCOUNT'] = ga_account
app.config['ANALYTICS']['ENABLED'] = True
register_blueprints(app)
register_extensions(app)
register_errors(app)