Skip to content

Commit

Permalink
Merge pull request #3505 from edx/adam/google-analytics
Browse files Browse the repository at this point in the history
factor out google analytics ids (LMS-2555)
  • Loading branch information
adampalay committed Apr 29, 2014
2 parents edabab3 + 8ad4cdb commit a2817d9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
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

0 comments on commit a2817d9

Please sign in to comment.