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
ee90c5fe
Commit
ee90c5fe
authored
Mar 06, 2015
by
Dino Cikatic
Committed by
marjev
Mar 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SOL-217 Remove Google Analytics calls
parent
dd34bada
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
30 deletions
+21
-30
common/lib/xmodule/xmodule/modulestore/courseware_index.py
+0
-23
lms/static/js/search/views/search_item_view.js
+9
-7
lms/static/js/spec/search/search_spec.js
+12
-0
No files found.
common/lib/xmodule/xmodule/modulestore/courseware_index.py
View file @
ee90c5fe
...
...
@@ -178,26 +178,3 @@ class CoursewareSearchIndexer(object):
event_name
,
data
)
try
:
if
settings
.
FEATURES
.
get
(
'SEGMENT_IO_LMS'
)
and
hasattr
(
settings
,
'SEGMENT_IO_LMS_KEY'
):
# Google Analytics - log index content request
import
analytics
analytics
.
track
(
event_name
,
data
,
context
=
{
'Google Analytics'
:
{
'clientId'
:
tracking_context
.
get
(
'client_id'
)
}
}
)
except
Exception
:
# pylint: disable=broad-except
# Capturing all exceptions thrown while tracking analytics events. We do not want
# an operation to fail because of an analytics event, so we will capture these
# errors in the logs.
log
.
exception
(
u'Unable to emit
%
s event for content indexing.'
,
event_name
,
)
lms/static/js/search/views/search_item_view.js
View file @
ee90c5fe
...
...
@@ -32,6 +32,14 @@ define([
return
this
;
},
/**
* Redirect to a URL. Mainly useful for mocking out in tests.
* @param {string} url The URL to redirect to.
*/
redirect
:
function
(
url
)
{
window
.
location
.
href
=
url
;
},
logSearchItem
:
function
(
event
)
{
event
.
preventDefault
();
var
target
=
this
.
model
.
id
;
...
...
@@ -47,13 +55,7 @@ define([
"result_position"
:
(
page
*
pageSize
+
index
),
"result_link"
:
target
});
window
.
analytics
.
track
(
'"edx.course.search.result_selected"'
,
{
category
:
'courseware_search'
,
search_term
:
searchTerm
,
result_position
:
(
page
*
pageSize
+
index
),
result_link
:
target
});
window
.
location
.
href
=
link
;
this
.
redirect
(
link
);
}
});
...
...
lms/static/js/spec/search/search_spec.js
View file @
ee90c5fe
...
...
@@ -117,6 +117,18 @@ define([
expect
(
this
.
item
.
$el
).
toContainHtml
(
breadcrumbs
);
});
it
(
'log request on follow item link'
,
function
()
{
this
.
model
.
collection
=
new
SearchCollection
([
this
.
model
],
{
course_id
:
'edx101'
});
this
.
item
.
render
();
// Mock the redirect call
spyOn
(
this
.
item
,
'redirect'
).
andCallFake
(
function
()
{}
);
spyOn
(
this
.
item
,
'logSearchItem'
).
andCallThrough
();
var
link
=
this
.
item
.
$el
.
find
(
'a'
);
expect
(
link
.
length
).
toBe
(
1
);
link
.
trigger
(
'click'
);
expect
(
this
.
item
.
redirect
).
toHaveBeenCalled
();
});
});
...
...
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