django-ga-mail reusable app
Today I published
django-ga-mail app on pypi. This app just sends analytics to my email box few times a week, so I don't need to open Google Analytics site to view analytics.
Installation is quite simple.
$ pip install django-ga-mail
Add ga_mail to your
INSTALLED_APPS = ( ..., 'ga_mail', )
Set next variables in settings:
GA_PROFILE_ID = 12345678 GA_USERNAME = 'email@example.com' # don't use your working account here, # create another one for analytics and give it access to ga profile GA_PASSWORD = 'somepass' GA_SOURCE_APP_NAME = 'some.site', ANALYTICS_BLOCKS = ( 'new_visitors_30days_today', 'new_visitors_7days_today_vs_14days_7days', 'pageviews_7days_today')
MANAGERS variable contains necessary emails.
python manage.py ga_mail to send analytics report.
I added next line to
/etc/crontab to send analytics one time a week:
22 5 * * 2 deploy cd /home/deploy/envs/mysite/ && .env/bin/python manage.py ga_mail
Updated letter templates. Added