Skip to content
Snippets Groups Projects
Commit a2e67cf2 authored by jvanboxtel@wisc.edu's avatar jvanboxtel@wisc.edu
Browse files

fix for google analytics tracking

parent 3b5e6a2b
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,9 @@ export class GoogleAnalyticsService {
}
router.events.subscribe(event => {
const studentDataCareer = constants.getStudentInfo().primaryCareer;
const studentDataCareer = constants.getStudentInfo()
? constants.getStudentInfo().primaryCareer
: false;
const careerAndAcademicLevel = studentDataCareer
? studentDataCareer.careerCode +
'-' +
......@@ -20,8 +22,8 @@ export class GoogleAnalyticsService {
: 'None';
if (event instanceof NavigationEnd) {
ga('set', 'page', '/degree-planner');
ga('send', 'pageview', { careerAndLevel: careerAndAcademicLevel });
ga('set', 'careerAndLevel', careerAndAcademicLevel);
ga('send', 'pageview', '/degree-planner');
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment