Skip to main content

Adds Google Analytics tracking to emails sent with Django.

Project description

Django Email Analytics adds Google Analytics tracking to emails sent with Django. It provides a wrapper for Django’s standard email backends.

Installation and Setup

Install with pip:

pip install django-email-analytics

Then set the email backend in the settings.py file.

EMAIL_BACKEND = 'emailanalytics.backends.AnalyticsEmailBackend'

Set EMAIL_ANALYTICS_BACKEND to the value you previously used for EMAIL_BACKEND. Or if EMAIL_BACKEND was unset, you can leave EMAIL_ANALYTICS_BACKEND unset as well. This will chain the email backends so that django-email-analytics will use your original backend to send messages.

Options

By default, URLs will be replaced only when the mimetype is text/html and the URL occurs within a href attribute.

Set EMAIL_ANALYTICS_REPLACE_TXT to True if you would like to also replace urls occuring in text emails.

Tracking details

If a URL already contains tracking parameters, they are left unchanged.

Otherwise, URLs are tagged with the following parameters:

  • utm_source is set to the subject of the email

  • utm_medium is set to email

  • utm_campaign is set to webapp

See here for a description of the tracking parameters.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-email-analytics-0.4.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file django-email-analytics-0.4.tar.gz.

File metadata

File hashes

Hashes for django-email-analytics-0.4.tar.gz
Algorithm Hash digest
SHA256 f0a951237a53ba32a3a4731940f7a1b528e36fa14c413a1e1938d36b8dcc24f4
MD5 7403c4084fbceb1a4bbd5f75374975ef
BLAKE2b-256 df37980dc8e9918b93370316934bd53928cdec6d747a2ba40ba2c2d78520f02d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page