追蹤使用者活動

您可以配置 Airflow 以將匿名資料路由至 Google AnalyticsSegmentMetarouterMatomo

編輯 airflow.cfg 並設定 webserver 區塊以擁有 analytics_toolanalytics_id (如果您使用 matomo,則還需要 analytics_url)

[webserver]
# Send anonymous user activity to Google Analytics, Segment, or Metarouter
analytics_tool = google_analytics # valid options: google_analytics, segment, metarouter, matomo
analytics_id = XXXXXXXXXXX
analytics_url = https://your-matomo-instance.example.com # only required for Matomo

注意

您可以在 Airflow 的原始碼 airflow/www/templates/airflow/main.html 中查看注入的追蹤器 html。相關的全域變數在 airflow/www/templates/app.py 中設定。

注意

有關設定配置的更多資訊,請參閱 設定配置選項

此條目是否有幫助?