Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

factor out google analytics ids (LMS-2555) #3490

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ def send_grandfather_email(self, user, certificates, mock_run=False):
'linkedin_add_url': self.certificate_url(cert),
})

context = {'courses_list': courses_list, 'num_courses': len(courses_list)}
context = {
'courses_list': courses_list,
'num_courses': len(courses_list),
'google_analytics': settings.GOOGLE_ANALYTICS_LINKEDIN,
}
body = render_to_string('linkedin/linkedin_email.html', context)
subject = u'{}, Add your Achievements to your LinkedIn Profile'.format(user.profile.name)
if mock_run:
Expand Down
4 changes: 4 additions & 0 deletions lms/envs/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,7 @@

##### ADVANCED_SECURITY_CONFIG #####
ADVANCED_SECURITY_CONFIG = ENV_TOKENS.get('ADVANCED_SECURITY_CONFIG', {})

##### GOOGLE ANALYTICS IDS #####
GOOGLE_ANALYTICS_ACCOUNT = AUTH_TOKENS.get('GOOGLE_ANALYTICS_ACCOUNT')
GOOGLE_ANALYTICS_LINKEDIN = AUTH_TOKENS.get('GOOGLE_ANALYTICS_LINKEDIN')
4 changes: 4 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@
TRACKING_IGNORE_URL_PATTERNS = [r'^/event', r'^/login', r'^/heartbeat']
TRACKING_ENABLED = True

######################## GOOGLE ANALYTICS ###########################
GOOGLE_ANALYTICS_ACCOUNT = 'GOOGLE_ANALYTICS_ACCOUNT_DUMMY'
GOOGLE_ANALYTICS_LINKEDIN = 'GOOGLE_ANALYTICS_LINKEDIN_DUMMY'

######################## subdomain specific settings ###########################
COURSE_LISTINGS = {}
SUBDOMAIN_BRANDING = {}
Expand Down
2 changes: 1 addition & 1 deletion lms/templates/google_analytics.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-35248639-1']);
_gaq.push(['_setAccount', ${settings.GOOGLE_ANALYTICS_ACCOUNT}]);
_gaq.push(['_trackPageview']);

(function() {
Expand Down
2 changes: 1 addition & 1 deletion lms/templates/linkedin/linkedin_email.html
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
<script type="text/javascript">
try {
var _gaq = _gaq || [];
_gaq.push(["_setAccount", "UA-329148-88"]);
_gaq.push(["_setAccount", ${google_analytics}]);
_gaq.push(["_setDomainName", ".campaign-archive.com"]);
_gaq.push(["_trackPageview"]);
_gaq.push(["_setAllowLinker", true]);
Expand Down