Dashboard modules¶
Google Analytics widgets¶
Attention
Google Analytics widgets required extra setup
Extra Installation¶
- Install python package:
pip install google-api-python-client
- Specify path to your Google Analytics
client_secrets.json
(obtained at Google website):
JET_MODULE_GOOGLE_ANALYTICS_CLIENT_SECRETS_FILE = os.path.join(PROJECT_DIR, 'client_secrets.json')
- Add import to the top of your urls.py:
from jet.dashboard.dashboard_modules import google_analytics_views
Usage example¶
from django.utils.translation import ugettext_lazy as _ from jet.dashboard.dashboard import Dashboard, AppIndexDashboard from jet.dashboard.dashboard_modules import google_analytics class CustomIndexDashboard(Dashboard): columns = 3 def init_with_context(self, context): self.available_children.append(google_analytics.GoogleAnalyticsVisitorsTotals) self.available_children.append(google_analytics.GoogleAnalyticsVisitorsChart) self.available_children.append(google_analytics.GoogleAnalyticsPeriodVisitors)
Yandex Metrika widgets¶
Attention
Yandex Metrika widgets required extra setup
Extra Installation¶
- Set your Yandex Metrika CLIENT_ID and CLIENT_SECRET (obtained at Yandex Metrika API website):
JET_MODULE_YANDEX_METRIKA_CLIENT_ID = 'YANDEX_METRIKA_CLIENT_ID'
JET_MODULE_YANDEX_METRIKA_CLIENT_SECRET = 'YANDEX_METRIKA_CLIENT_SECRET'
- Add import to the top of your urls.py:
from jet.dashboard.dashboard_modules import yandex_metrika_views
Usage example¶
from django.utils.translation import ugettext_lazy as _ from jet.dashboard.dashboard import Dashboard, AppIndexDashboard from jet.dashboard.dashboard_modules import yandex_metrika class CustomIndexDashboard(Dashboard): columns = 3 def init_with_context(self, context): self.available_children.append(yandex_metrika.YandexMetrikaVisitorsTotals) self.available_children.append(yandex_metrika.YandexMetrikaVisitorsChart) self.available_children.append(yandex_metrika.YandexMetrikaPeriodVisitors)