Run GA instructions only if gaCode is set
This commit is contained in:
parent
c96a4602cd
commit
efaae492c4
|
@ -1,10 +1,13 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
import config from 'travis/config/environment';
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
actions: {
|
actions: {
|
||||||
gaCta(location) {
|
gaCta(location) {
|
||||||
_gaq.push(['_trackPageview', '/virtual/signup?' + location]);
|
if(config.gaCode) {
|
||||||
return this.auth.signIn();
|
_gaq.push(['_trackPageview', '/virtual/signup?' + location]);
|
||||||
|
}
|
||||||
|
this.auth.signIn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,8 +3,10 @@ import Ember from 'ember';
|
||||||
export default Ember.Controller.extend({
|
export default Ember.Controller.extend({
|
||||||
actions: {
|
actions: {
|
||||||
gaCta(location) {
|
gaCta(location) {
|
||||||
_gaq.push(['_trackPageview', '/virtual/signup?' + location]);
|
if(config.gaCode) {
|
||||||
return this.auth.signIn();
|
_gaq.push(['_trackPageview', '/virtual/signup?' + location]);
|
||||||
|
}
|
||||||
|
this.auth.signIn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -33,7 +33,7 @@ var Router = Ember.Router.extend({
|
||||||
didTransition() {
|
didTransition() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
if (config.gaCode) {
|
if (config.gaCode) {
|
||||||
return _gaq.push(['_trackPageview', location.pathname]);
|
_gaq.push(['_trackPageview', location.pathname]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user