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
1ce2affd
Commit
1ce2affd
authored
Apr 03, 2013
by
Mark L. Chang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
outline page event tracking
parent
2e482127
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
3 deletions
+53
-3
cms/static/js/base.js
+47
-1
cms/templates/widgets/segment-io.html
+6
-2
No files found.
cms/static/js/base.js
View file @
1ce2affd
...
@@ -331,6 +331,12 @@ function createNewUnit(e) {
...
@@ -331,6 +331,12 @@ function createNewUnit(e) {
var
parent
=
$
(
this
).
data
(
'parent'
);
var
parent
=
$
(
this
).
data
(
'parent'
);
var
template
=
$
(
this
).
data
(
'template'
);
var
template
=
$
(
this
).
data
(
'template'
);
analytics
.
track
(
'Created a Unit'
,
{
'course'
:
course_location_analytics
,
'parent_location'
:
parent
});
$
.
post
(
'/clone_item'
,
$
.
post
(
'/clone_item'
,
{
'parent_location'
:
parent
,
{
'parent_location'
:
parent
,
'template'
:
template
,
'template'
:
template
,
...
@@ -363,6 +369,12 @@ function _deleteItem($el) {
...
@@ -363,6 +369,12 @@ function _deleteItem($el) {
var
id
=
$el
.
data
(
'id'
);
var
id
=
$el
.
data
(
'id'
);
analytics
.
track
(
'Deleted an Item'
,
{
'course'
:
course_location_analytics
,
'id'
:
id
});
$
.
post
(
'/delete_item'
,
$
.
post
(
'/delete_item'
,
{
'id'
:
id
,
'delete_children'
:
true
,
'delete_all_versions'
:
true
},
{
'id'
:
id
,
'delete_children'
:
true
,
'delete_all_versions'
:
true
},
function
(
data
)
{
function
(
data
)
{
...
@@ -426,6 +438,11 @@ function displayFinishedUpload(xhr) {
...
@@ -426,6 +438,11 @@ function displayFinishedUpload(xhr) {
var html = Mustache.to_html(template, resp);
var html = Mustache.to_html(template, resp);
$('
table
>
tbody
').prepend(html);
$('
table
>
tbody
').prepend(html);
analytics.track('
Uploaded
a
File
', {
'
course
': course_location_analytics,
'
asset_url
': resp.url
});
}
}
function markAsLoaded() {
function markAsLoaded() {
...
@@ -555,6 +572,11 @@ function saveNewSection(e) {
...
@@ -555,6 +572,11 @@ function saveNewSection(e) {
var
template
=
$saveButton
.
data
(
'template'
);
var
template
=
$saveButton
.
data
(
'template'
);
var
display_name
=
$
(
this
).
find
(
'.new-section-name'
).
val
();
var
display_name
=
$
(
this
).
find
(
'.new-section-name'
).
val
();
analytics
.
track
(
'Created a Section'
,
{
'course'
:
course_location_analytics
,
'display_name'
:
display_name
});
$
.
post
(
'/clone_item'
,
{
$
.
post
(
'/clone_item'
,
{
'parent_location'
:
parent
,
'parent_location'
:
parent
,
'template'
:
template
,
'template'
:
template
,
...
@@ -600,6 +622,12 @@ function saveNewCourse(e) {
...
@@ -600,6 +622,12 @@ function saveNewCourse(e) {
return
;
return
;
}
}
analytics
.
track
(
'Created a Course'
,
{
'org'
:
org
,
'number'
:
number
,
'display_name'
:
display_name
});
$
.
post
(
'/create_new_course'
,
{
$
.
post
(
'/create_new_course'
,
{
'template'
:
template
,
'template'
:
template
,
'org'
:
org
,
'org'
:
org
,
...
@@ -646,9 +674,14 @@ function saveNewSubsection(e) {
...
@@ -646,9 +674,14 @@ function saveNewSubsection(e) {
var
parent
=
$
(
this
).
find
(
'.new-subsection-name-save'
).
data
(
'parent'
);
var
parent
=
$
(
this
).
find
(
'.new-subsection-name-save'
).
data
(
'parent'
);
var
template
=
$
(
this
).
find
(
'.new-subsection-name-save'
).
data
(
'template'
);
var
template
=
$
(
this
).
find
(
'.new-subsection-name-save'
).
data
(
'template'
);
var
display_name
=
$
(
this
).
find
(
'.new-subsection-name-input'
).
val
();
var
display_name
=
$
(
this
).
find
(
'.new-subsection-name-input'
).
val
();
analytics
.
track
(
'Created a Subsection'
,
{
'course'
:
course_location_analytics
,
'display_name'
:
display_name
});
$
.
post
(
'/clone_item'
,
{
$
.
post
(
'/clone_item'
,
{
'parent_location'
:
parent
,
'parent_location'
:
parent
,
'template'
:
template
,
'template'
:
template
,
...
@@ -702,6 +735,13 @@ function saveEditSectionName(e) {
...
@@ -702,6 +735,13 @@ function saveEditSectionName(e) {
return
;
return
;
}
}
analytics
.
track
(
'Edited Section Name'
,
{
'course'
:
course_location_analytics
,
'display_name'
:
display_name
,
'id'
:
id
});
var
$_this
=
$
(
this
);
var
$_this
=
$
(
this
);
// call into server to commit the new order
// call into server to commit the new order
$
.
ajax
({
$
.
ajax
({
...
@@ -741,6 +781,12 @@ function saveSetSectionScheduleDate(e) {
...
@@ -741,6 +781,12 @@ function saveSetSectionScheduleDate(e) {
var
id
=
$modal
.
attr
(
'data-id'
);
var
id
=
$modal
.
attr
(
'data-id'
);
analytics
.
track
(
'Edited Section Release Date'
,
{
'course'
:
course_location_analytics
,
'id'
:
id
,
'start'
:
start
});
// call into server to commit the new order
// call into server to commit the new order
$
.
ajax
({
$
.
ajax
({
url
:
"/save_item"
,
url
:
"/save_item"
,
...
...
cms/templates/widgets/segment-io.html
View file @
1ce2affd
% if settings.MITX_FEATURES.get('SEGMENT_IO'):
% if settings.MITX_FEATURES.get('SEGMENT_IO'):
<!-- begin Segment.io -->
<!-- begin Segment.io -->
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
// if inside course, inject the course location into the JS namespace
%
if
context_course
:
var
course_location_analytics
=
"${context_course.location}"
;
%
endif
var
analytics
=
analytics
||
[];
analytics
.
load
=
function
(
e
){
var
t
=
document
.
createElement
(
"script"
);
t
.
type
=
"text/javascript"
,
t
.
async
=!
0
,
t
.
src
=
(
"https:"
===
document
.
location
.
protocol
?
"https://"
:
"http://"
)
+
"d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/"
+
e
+
"/analytics.min.js"
;
var
n
=
document
.
getElementsByTagName
(
"script"
)[
0
];
n
.
parentNode
.
insertBefore
(
t
,
n
);
var
r
=
function
(
e
){
return
function
(){
analytics
.
push
([
e
].
concat
(
Array
.
prototype
.
slice
.
call
(
arguments
,
0
)))}},
i
=
[
"identify"
,
"track"
,
"trackLink"
,
"trackForm"
,
"trackClick"
,
"trackSubmit"
,
"pageview"
,
"ab"
,
"alias"
,
"ready"
];
for
(
var
s
=
0
;
s
<
i
.
length
;
s
++
)
analytics
[
i
[
s
]]
=
r
(
i
[
s
])};
var
analytics
=
analytics
||
[];
analytics
.
load
=
function
(
e
){
var
t
=
document
.
createElement
(
"script"
);
t
.
type
=
"text/javascript"
,
t
.
async
=!
0
,
t
.
src
=
(
"https:"
===
document
.
location
.
protocol
?
"https://"
:
"http://"
)
+
"d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/"
+
e
+
"/analytics.min.js"
;
var
n
=
document
.
getElementsByTagName
(
"script"
)[
0
];
n
.
parentNode
.
insertBefore
(
t
,
n
);
var
r
=
function
(
e
){
return
function
(){
analytics
.
push
([
e
].
concat
(
Array
.
prototype
.
slice
.
call
(
arguments
,
0
)))}},
i
=
[
"identify"
,
"track"
,
"trackLink"
,
"trackForm"
,
"trackClick"
,
"trackSubmit"
,
"pageview"
,
"ab"
,
"alias"
,
"ready"
];
for
(
var
s
=
0
;
s
<
i
.
length
;
s
++
)
analytics
[
i
[
s
]]
=
r
(
i
[
s
])};
analytics
.
load
(
"${ settings.SEGMENT_IO_KEY }"
);
analytics
.
load
(
"${ settings.SEGMENT_IO_KEY }"
);
...
@@ -13,4 +18,4 @@
...
@@ -13,4 +18,4 @@
%
endif
%
endif
</script>
</script>
<!-- end Segment.io -->
<!-- end Segment.io -->
% endif
% endif
\ No newline at end of file
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