Skip to content

Commit

Permalink
Small refactor of referrer
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldowman committed Nov 6, 2015
1 parent c496265 commit 905368c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions client/meteor-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,12 @@ if (_IronRouter) {
}

if (_FlowRouter) {
var lastRoutePath;
_FlowRouter.triggers.enter([function(context){
var page = {};
page.path = context.path;
page.title = context.context.title;
page.url = window.location.origin + page.path;

_FlowRouter.lastRoutePath = lastRoutePath;
lastRoutePath = page.path;

if (context.route && context.route.name) {
page.name = context.route.name;
} else {
Expand All @@ -114,8 +110,9 @@ if (_FlowRouter) {
if (_FlowRouter.lastRoutePath) {
page.referrer = window.location.origin + _FlowRouter.lastRoutePath;
} else {
page.referrer = document.referrer
page.referrer = document.referrer;
}
_FlowRouter.lastRoutePath = page.path;

trackPageWhenReady(page.name, page);
}]);
Expand Down

1 comment on commit 905368c

@benstr
Copy link
Contributor

@benstr benstr commented on 905368c Nov 6, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Please sign in to comment.