urls: Provide email as a GET parameter.

Since we want to use `accounts/new/send_confirm` to know how many
users actually register after visiting the register page, we
added it to Google Tag Manager, but GTM tracks every user
registration separately due <email> in the URL
making it harder to track.

To solve this, we want to pass <email> as a GET parameter which
can be easily filtered inside GTM using a RegEx and all the
registrations can be tracked as one.
This commit is contained in:
Aman Agrawal
2023-01-20 07:22:48 +00:00
committed by Tim Abbott
parent a51bf96c70
commit 37431cf0b5
8 changed files with 190 additions and 45 deletions

View File

@@ -13,7 +13,7 @@ from django.contrib.auth.views import (
from django.urls import path, re_path
from django.urls.resolvers import URLPattern, URLResolver
from django.utils.module_loading import import_string
from django.views.generic import RedirectView, TemplateView
from django.views.generic import RedirectView
from zerver.forms import LoggingSetPasswordForm
from zerver.lib.integrations import WEBHOOK_INTEGRATIONS
@@ -126,6 +126,7 @@ from zerver.views.registration import (
get_prereg_key_and_redirect,
new_realm_send_confirm,
realm_redirect,
signup_send_confirm,
)
from zerver.views.report import (
report_csp_violations,
@@ -565,12 +566,12 @@ i18n_urls = [
# Registration views, require a confirmation ID.
path("accounts/home/", accounts_home),
path(
"accounts/send_confirm/<email>",
TemplateView.as_view(template_name="zerver/accounts_send_confirm.html"),
"accounts/send_confirm/",
signup_send_confirm,
name="signup_send_confirm",
),
path(
"accounts/new/send_confirm/<email>",
"accounts/new/send_confirm/",
new_realm_send_confirm,
name="new_realm_send_confirm",
),