Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
b686abc1
Commit
b686abc1
authored
Feb 17, 2016
by
Bill DeRusha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable mailchimp integration for most segment identify requests
parent
f58c2cd6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
13 deletions
+47
-13
cms/templates/widgets/segment-io-footer.html
+15
-4
common/djangoapps/student/tests/test_create_account.py
+1
-0
common/djangoapps/student/views.py
+16
-5
lms/templates/widgets/segment-io-footer.html
+15
-4
No files found.
cms/templates/widgets/segment-io-footer.html
View file @
b686abc1
...
...
@@ -5,10 +5,21 @@
// We can't use JQuery's on load method because it
// screws up RequireJS' JQuery initialization.
var
onLoadCallback
=
function
()
{
analytics
.
identify
(
"${user.id}"
,
{
email
:
"${user.email}"
,
username
:
"${user.username}"
});
analytics
.
identify
(
"${user.id}"
,
{
email
:
"${user.email}"
,
username
:
"${user.username}"
},
{
integrations
:
{
// Disable MailChimp because we don't want to update the user's email
// and username in MailChimp on every page load. We only need to capture
// this data on registration/activation.
MailChimp
:
false
}
}
);
};
if
(
window
.
addEventListener
)
{
window
.
addEventListener
(
"load"
,
onLoadCallback
,
false
);
...
...
common/djangoapps/student/tests/test_create_account.py
View file @
b686abc1
...
...
@@ -136,6 +136,7 @@ class TestCreateAccount(TestCase):
'username'
:
self
.
params
[
'username'
],
'name'
:
self
.
params
[
'name'
],
'age'
:
13
,
'yearOfBirth'
:
year_of_birth
,
'education'
:
'Associate degree'
,
'address'
:
self
.
params
[
'mailing_address'
],
'gender'
:
'Other/Prefer Not to Say'
,
...
...
common/djangoapps/student/views.py
View file @
b686abc1
...
...
@@ -1242,10 +1242,19 @@ def login_user(request, error=""): # pylint: disable=too-many-statements,unused
# Track the user's sign in
if
hasattr
(
settings
,
'LMS_SEGMENT_KEY'
)
and
settings
.
LMS_SEGMENT_KEY
:
tracking_context
=
tracker
.
get_tracker
()
.
resolve_context
()
analytics
.
identify
(
user
.
id
,
{
'email'
:
email
,
'username'
:
username
})
analytics
.
identify
(
user
.
id
,
{
'email'
:
email
,
'username'
:
username
},
{
# Disable MailChimp because we don't want to update the user's email
# and username in MailChimp on every page load. We only need to capture
# this data on registration/activation.
'MailChimp'
:
False
}
)
analytics
.
track
(
user
.
id
,
...
...
@@ -1699,7 +1708,9 @@ def create_account_with_params(request, params):
'email'
:
user
.
email
,
'username'
:
user
.
username
,
'name'
:
profile
.
name
,
'age'
:
profile
.
age
,
# Mailchimp requires the age & yearOfBirth to be integers, we send a sane integer default if falsey.
'age'
:
profile
.
age
or
-
1
,
'yearOfBirth'
:
profile
.
year_of_birth
or
datetime
.
datetime
.
now
(
UTC
)
.
year
,
'education'
:
profile
.
level_of_education_display
,
'address'
:
profile
.
mailing_address
,
'gender'
:
profile
.
gender_display
,
...
...
lms/templates/widgets/segment-io-footer.html
View file @
b686abc1
...
...
@@ -3,10 +3,21 @@
<script
type=
"text/javascript"
>
%
if
user
.
is_authenticated
():
$
(
window
).
load
(
function
()
{
analytics
.
identify
(
"${user.id}"
,
{
email
:
"${user.email}"
,
username
:
"${user.username}"
});
analytics
.
identify
(
"${user.id}"
,
{
email
:
"${user.email}"
,
username
:
"${user.username}"
},
{
integrations
:
{
// Disable MailChimp because we don't want to update the user's email
// and username in MailChimp on every page load. We only need to capture
// this data on registration/activation.
MailChimp
:
false
}
}
);
});
%
endif
</script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment