-
Notifications
You must be signed in to change notification settings - Fork 63
[ENG-4002] log pageviews to osf:metrics #1640
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
brianjgeiger
merged 12 commits into
CenterForOpenScience:develop
from
aaxelb:feature/keen-replacement
Sep 22, 2022
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d76ee4e
log pageviews to osf metrics
aaxelb 244ad22
include route_name in pageview info
aaxelb 1e7320e
cleaner getCurrentGuid
aaxelb 5a63636
tidy up route analytics
aaxelb 55bf557
handle sometimes-missing things
aaxelb 691831f
undo changes
aaxelb 20edd84
add osf-metrics metrics-adapter
aaxelb 6608751
basic trackPage test
aaxelb 98f69aa
no-config osf-metrics
aaxelb 6c2ebef
update analytics docs
aaxelb 657b78e
Merge branch 'develop' into feature/keen-replacement
aaxelb e5702ff
split `searchProviderId` in two
aaxelb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,14 @@ | ||
| import { action } from '@ember/object'; | ||
| import Transition from '@ember/routing/-private/transition'; | ||
| import Route from '@ember/routing/route'; | ||
| import { inject as service } from '@ember/service'; | ||
| import Session from 'ember-simple-auth/services/session'; | ||
|
|
||
| import Analytics from 'ember-osf-web/services/analytics'; | ||
|
|
||
| export default class Goodbye extends Route { | ||
| @service analytics!: Analytics; | ||
| @service session!: Session; | ||
|
|
||
| async beforeModel(transition: Transition) { | ||
| await super.beforeModel(transition); | ||
| const queryParams = this.session.isAuthenticated ? {} : { goodbye: true }; | ||
| this.transitionTo('home', { queryParams }); | ||
| } | ||
|
|
||
| @action | ||
| didTransition() { | ||
| this.analytics.trackPage(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,7 @@ | ||
| import { action } from '@ember/object'; | ||
| import Route from '@ember/routing/route'; | ||
| import { inject as service } from '@ember/service'; | ||
|
|
||
| import Node from 'ember-osf-web/models/node'; | ||
| import { GuidRouteModel } from 'ember-osf-web/resolve-guid/guid-route'; | ||
| import Analytics from 'ember-osf-web/services/analytics'; | ||
| import Ready from 'ember-osf-web/services/ready'; | ||
|
|
||
| export default class GuidNodeForks extends Route { | ||
| @service analytics!: Analytics; | ||
| @service ready!: Ready; | ||
|
|
||
| model() { | ||
| return this.modelFor('guid-node'); | ||
| } | ||
|
|
||
| @action | ||
| async didTransition() { | ||
| const { taskInstance } = this.controller.model as GuidRouteModel<Node>; | ||
| await taskInstance; | ||
| const node = taskInstance.value; | ||
| this.analytics.trackPage(node ? node.public : undefined, 'nodes'); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,12 @@ | ||
| import { action } from '@ember/object'; | ||
| import Route from '@ember/routing/route'; | ||
| import { inject as service } from '@ember/service'; | ||
|
|
||
| import Registration from 'ember-osf-web/models/registration'; | ||
| import { GuidRouteModel } from 'ember-osf-web/resolve-guid/guid-route'; | ||
| import Analytics from 'ember-osf-web/services/analytics'; | ||
| import Ready from 'ember-osf-web/services/ready'; | ||
|
|
||
| export default class GuidRegistrationForks extends Route { | ||
| @service analytics!: Analytics; | ||
| @service ready!: Ready; | ||
|
|
||
| model() { | ||
| return this.modelFor('guid-registration'); | ||
| } | ||
|
|
||
| @action | ||
| async didTransition() { | ||
| const { taskInstance } = this.controller.model as GuidRouteModel<Registration>; | ||
| await taskInstance; | ||
| const registration = taskInstance.value; | ||
| this.analytics.trackPage(registration ? registration.public : undefined, 'registrations'); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,11 @@ | ||
| import Store from '@ember-data/store'; | ||
| import { action } from '@ember/object'; | ||
| import Route from '@ember/routing/route'; | ||
| import { inject as service } from '@ember/service'; | ||
|
|
||
| import Analytics from 'ember-osf-web/services/analytics'; | ||
|
|
||
| export default class Institutions extends Route { | ||
| @service analytics!: Analytics; | ||
| @service store!: Store; | ||
|
|
||
| model() { | ||
| return this.store.findAll('institution'); | ||
| } | ||
|
|
||
| @action | ||
| didTransition() { | ||
| this.analytics.trackPage(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,4 @@ | ||
| import { action } from '@ember/object'; | ||
| import Route from '@ember/routing/route'; | ||
| import { inject as service } from '@ember/service'; | ||
|
|
||
| import Analytics from 'ember-osf-web/services/analytics'; | ||
|
|
||
| export default class MeetingsIndex extends Route { | ||
| @service analytics!: Analytics; | ||
|
|
||
| @action | ||
| didTransition() { | ||
| this.analytics.trackPage(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this. I'd been meaning to, but you know how it is.