追蹤使用者活動¶
您可以配置 Airflow 以將匿名資料路由至 Google Analytics、Segment、Metarouter 或 Matomo。
編輯 airflow.cfg
並設定 webserver
區塊以擁有 analytics_tool
和 analytics_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
中設定。
注意
有關設定配置的更多資訊,請參閱 設定配置選項