Skip to content

Use ember-metrics to handle Google Analytics #839

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

Merged
merged 1 commit into from
Jul 1, 2017
Merged

Use ember-metrics to handle Google Analytics #839

merged 1 commit into from
Jul 1, 2017

Conversation

sivakumar-kailasam
Copy link
Contributor

Takes care of async loading of ga.js & disables on ember 'dev' & 'test' environments.

Ember.run.scheduleOnce('afterRender', this, () => {
const page = this.get('url');
const title = this.getWithDefault('currentRouteName', 'unknown');
Ember.get(this, 'metrics').trackPage({ page, title });
Copy link
Member

Choose a reason for hiding this comment

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

Is the afterRender scheduling necessary here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it an overkill? Thought I'd keep it there for prioritising the route load over ga stuff

Copy link
Member

Choose a reason for hiding this comment

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

just noticed that it's mentioned in the ember-metrics README like this, so it's probably fine. still wondering if it's really still needed though.

title: this.get('url')
Ember.run.scheduleOnce('afterRender', this, () => {
const page = this.get('url');
const title = this.getWithDefault('currentRouteName', 'unknown');
Copy link
Member

Choose a reason for hiding this comment

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

title had been set to this.get('url') too until now. maybe we should keep it like that for now and change that in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah thought I'd get opinions on the PR on this. Will switch to current values

@Turbo87 Turbo87 merged commit 9f9be0c into rust-lang:master Jul 1, 2017
@sivakumar-kailasam sivakumar-kailasam deleted the move-ga-to-addon branch July 2, 2017 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants