djangocms-call-to-action
A djangocms plugin that allows you to create Call To Action (CTA) indicators, to display them as buttons in a Django CMS plugin, to track user click on these buttons on a GA conversion tunnel. Each CTA is linked with a fobi form which registers the user email in a given mailing list.
This project is a WIP and might need some improvements.
Installation
This plugin requires Django-CMS, sendgrid, django-fobi.
- Install module using pipenv:
pipenv install djangocms-call-to-action
- Or pip:
pip install djangocms-call-to-action
- Add it to your installed apps:
"djangocms_call_to_action",
- Apply migrations
py manage.py migrate djangocms_call_to_action
- Include your sendgrid api key in your settings
DJANGOCMS_CTA_SENDGRID_API_KEY = "YOUR_API_KEY"
- Or load it using an environment var:
import os
DJANGOCMS_CTA_SENDGRID_API_KEY = os.getenv("SENDGRID_API_KEY", None)
- Include your Google analytics GA code in your settings
DJANGOCMS_CTA_GA_UA = "UA-*******-*"
- Or load it using an environment var:
import os
DJANGOCMS_CTA_GA_UA = os.getenv("GA_UA", None)
- Include the CTAFobiFormWidgetRedirectMiddleware before all other middlewares, and CTAPagePermissionMiddleware after django-cms CurrentPageMiddleware:
MIDDLEWARE = (
"djangocms_call_to_action.middleware.CTAFobiFormWidgetRedirectMiddleware",
...
"cms.middleware.page.CurrentPageMiddleware",
...
"djangocms_call_to_action.middleware.CTAPagePermissionMiddleware",
)
- Add
djangocms_call_to_action.urlsto your urls:
urlpatterns = [
...
path("cta/", include("djangocms_call_to_action.urls")),
...
re_path("^", include("cms.urls")),
]
Optional settings
- Configure templates used to display the CMS plugin
from django.utils.translation import ugettext_lazy as _
DJANGOCMS_CTA_TEMPLATES = (("default.html", _("Link")), ("button_primary.html", _("Button primary")), ("button_secondary.html", _("Button secondary")),)
- Activate select2 for cms page selectors (requires django-select2)
DJANGOCMS_CTA_USE_SELECT2 = True
- Configure labels used for actions in GA
DJANGOCMS_CTA_DISPLAYED_USER_GA_LABEL = "Affiché"
DJANGOCMS_CTA_CLICKED_USER_GA_LABEL = "Cliqué"
DJANGOCMS_CTA_CONVERTED_USER_GA_LABEL = "Converti"
- Change cache duration for deny pages ids
DJANGOCMS_CTA_DENY_PAGES_IDS_CACHE_DURATION = 24 * 60 * 60 # Cache for 24h
How to use
- Create a fobi form using fobi interface.
In order to work properly with sendgrid registration, the form must contains the following fields: - First name - Last name - Email - An opt-in checkbox to consent the user email registration on sendgrid list
-
Add the sendgrid handler to register the email address of the user into
-
Create a CMS page to display the fobi form into
-
Insert the fobi form into the new page, using the CMS plugin "Call to Action"
-
On the django admin, create a Campaign linked with the CMS page created on step 4. Choose where the user will be redirected on form validation:
- To an external link
- To an internal link
- To a file
You can choose to deny the access to the page if the form was not validated by the user.
- On your content, insert some CTA plugins to redirect to the form using the "Click To Action" cms plugin
Metadata
Release files for djangocms-call-to-action 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| djangocms-call-to-action-0.0.4.tar.gz | 16.9 kB | Without provenance | Details for djangocms-call-to-action-0.0.4.tar.gz |
Release files / djangocms-call-to-action-0.0.4.tar.gz
| Download URL | djangocms-call-to-action-0.0.4.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8a0af858880b4e6ca92887f0f6489200f0dc00af1f8da12dd7f6b1136cec425
|
|
BLAKE2b-256 checksum How to use checksums |
00d590d6e60fcb9e0cfbd0ac33e37e6477b85cc30825ca1a0db4f86fae839e91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3
|
Security for djangocms-call-to-action 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.