-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James William Dumay
authored
Oct 23, 2017
1 parent
b998ba2
commit b2c2327
Showing
18 changed files
with
189 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Analytics Events | ||
================ | ||
|
||
| Event Name | Description | | ||
| ------------- | ------------- | | ||
| dashboard_visited | Send when user visits the Dashboard | | ||
| pageview | Send every time the page is visited or the view is changed | | ||
| pipeline_activity_visited | Send every time the Pipeline activity tab is visited | | ||
| pipeline_creation_visited | Sent when the user clicks the `New Pipeline` button | | ||
| pipeline_branches_visited | Send every time the Pipeline branches tab is visited | | ||
| pipeline_pull_requests_visited | Send every time the Pipeline pull requests tab is visited | | ||
| pipeline_run_visited | Send every time the Pipeline run result is visited | | ||
| pipeline_run_changes_visited | Send every time the Pipeline run changes is visited | | ||
| pipeline_run_tests_visited | Send every time the Pipeline run tests is visited | | ||
|
This file contains 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { analyticsService } from '@jenkins-cd/blueocean-core-js'; | ||
|
||
/** codifies all events send to analytics service in this module */ | ||
class Analytics { | ||
trackPageView() { | ||
analyticsService.track('pageview', { mode: 'blueocean' }); | ||
} | ||
|
||
trackPipelineActivityVisited() { | ||
analyticsService.track('pipeline_activity_visited'); | ||
} | ||
|
||
trackPipelineBranchesVisited() { | ||
analyticsService.track('pipeline_branches_visited'); | ||
} | ||
|
||
trackPipelinePullRequestsVisited() { | ||
analyticsService.track('pipeline_pull_requests_visited'); | ||
} | ||
|
||
trackDashboardVisited() { | ||
analyticsService.track('dashboard_visited'); | ||
} | ||
|
||
trackPipelineCreationVisited() { | ||
analyticsService.track('pipeline_creation_visited'); | ||
} | ||
|
||
trackPipelineRunVisited() { | ||
analyticsService.track('pipeline_run_visited'); | ||
} | ||
|
||
trackPipelineRunChangesVisited() { | ||
analyticsService.track('pipeline_run_changes_visited'); | ||
} | ||
|
||
trackPipelineRunTestsVisited() { | ||
analyticsService.track('pipeline_run_tests_visited'); | ||
} | ||
|
||
trackPipelineRunArtifactsVisited() { | ||
analyticsService.track('pipeline_run_artifacts_visited'); | ||
} | ||
} | ||
|
||
const analytics = new Analytics(); | ||
|
||
export { | ||
analytics, | ||
}; |
This file contains 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 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 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 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 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
5 changes: 4 additions & 1 deletion
5
.../main/resources/io/jenkins/blueocean/service/embedded/BlueOceanRootActionUrl/action.jelly
This file contains 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,7 +1,10 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout"> | ||
<j:if test="${action.analyticsEnabled}"> | ||
<script src="${rootURL}/plugin/blueocean-rest-impl/scripts/analytics.js"></script> | ||
</j:if> | ||
<l:task icon="${h.getIconFilePath(action)}" title="${action.displayName}" | ||
href="${rootURL}/${action.urlName}" | ||
permission="${app.READ}" | ||
/> | ||
</j:jelly> | ||
</j:jelly> |
5 changes: 4 additions & 1 deletion
5
.../src/main/resources/io/jenkins/blueocean/service/embedded/BlueOceanUrlAction/action.jelly
This file contains 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,7 +1,10 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout"> | ||
<j:if test="${action.analyticsEnabled}"> | ||
<script src="${rootURL}/plugin/blueocean-rest-impl/scripts/analytics.js"></script> | ||
</j:if> | ||
<l:task icon="${h.getIconFilePath(action)}" title="${action.displayName}" | ||
href="${rootURL}/${action.urlName}" | ||
permission="${app.READ}" | ||
/> | ||
</j:jelly> | ||
</j:jelly> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
window.addEventListener('load', function() { | ||
var eventData = { name: 'pageview', properties: { mode: 'classic' } }; | ||
new Ajax.Request(rootURL + '/blue/rest/analytics/track', { | ||
method: 'POST', | ||
contentType:'application/json', | ||
postBody: JSON.stringify(eventData), | ||
onFailure: function() { console.error('Could not send pageview event') }, | ||
}); | ||
}); |
Oops, something went wrong.