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
a031bf95
Unverified
Commit
a031bf95
authored
Nov 15, 2017
by
Gabe Mulley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract tracking_id logic into a method
parent
46c73272
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
openedx/core/djangoapps/schedules/tracking.py
+7
-4
No files found.
openedx/core/djangoapps/schedules/tracking.py
View file @
a031bf95
...
...
@@ -87,10 +87,7 @@ class GoogleAnalyticsTrackingPixel(object):
parameter_name
=
attribute
.
metadata
[
'param_name'
]
parameters
[
parameter_name
]
=
str
(
value
)
tracking_id
=
get_config_value_from_site_or_settings
(
"GOOGLE_ANALYTICS_ACCOUNT"
,
site
=
self
.
site
)
if
tracking_id
is
None
:
tracking_id
=
get_config_value_from_site_or_settings
(
"GOOGLE_ANALYTICS_TRACKING_ID"
,
site
=
self
.
site
)
tracking_id
=
self
.
_get_tracking_id
()
if
tracking_id
is
None
:
return
None
...
...
@@ -106,3 +103,9 @@ class GoogleAnalyticsTrackingPixel(object):
parameters
[
param_name
]
=
unicode
(
self
.
course_id
)
return
u"https://www.google-analytics.com/collect?{params}"
.
format
(
params
=
urlencode
(
parameters
))
def
_get_tracking_id
(
self
):
tracking_id
=
get_config_value_from_site_or_settings
(
"GOOGLE_ANALYTICS_ACCOUNT"
,
site
=
self
.
site
)
if
tracking_id
is
None
:
tracking_id
=
get_config_value_from_site_or_settings
(
"GOOGLE_ANALYTICS_TRACKING_ID"
,
site
=
self
.
site
)
return
tracking_id
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