Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
17114e5f
Commit
17114e5f
authored
Nov 02, 2020
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add design_action usage ping to view tracking
parent
eb411321
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
5 deletions
+30
-5
app/assets/javascripts/design_management/pages/design/index.vue
...sets/javascripts/design_management/pages/design/index.vue
+9
-4
app/assets/javascripts/design_management/utils/tracking.js
app/assets/javascripts/design_management/utils/tracking.js
+16
-1
changelogs/unreleased/fe-design0view-usage-ping.yml
changelogs/unreleased/fe-design0view-usage-ping.yml
+5
-0
No files found.
app/assets/javascripts/design_management/pages/design/index.vue
View file @
17114e5f
...
...
@@ -4,6 +4,7 @@ import { GlLoadingIcon, GlAlert } from '@gitlab/ui';
import
{
ApolloMutation
}
from
'
vue-apollo
'
;
import
createFlash
from
'
~/flash
'
;
import
{
fetchPolicies
}
from
'
~/lib/graphql
'
;
import
glFeatureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
allVersionsMixin
from
'
../../mixins/all_versions
'
;
import
Toolbar
from
'
../../components/toolbar/index.vue
'
;
import
DesignDestroyer
from
'
../../components/design_destroyer.vue
'
;
...
...
@@ -37,7 +38,7 @@ import {
TOGGLE_TODO_ERROR
,
designDeletionError
,
}
from
'
../../utils/error_messages
'
;
import
{
trackDesignDetailView
}
from
'
../../utils/tracking
'
;
import
{
trackDesignDetailView
,
usagePingDesignDetailView
}
from
'
../../utils/tracking
'
;
import
{
DESIGNS_ROUTE_NAME
}
from
'
../../router/constants
'
;
import
{
ACTIVE_DISCUSSION_SOURCE_TYPES
,
DESIGN_DETAIL_LAYOUT_CLASSLIST
}
from
'
../../constants
'
;
...
...
@@ -55,7 +56,7 @@ export default {
GlAlert
,
DesignSidebar
,
},
mixins
:
[
allVersionsMixin
],
mixins
:
[
allVersionsMixin
,
glFeatureFlagsMixin
()
],
props
:
{
id
:
{
type
:
String
,
...
...
@@ -150,7 +151,7 @@ export default {
},
mounted
()
{
Mousetrap
.
bind
(
'
esc
'
,
this
.
closeDesign
);
this
.
trackEvent
();
this
.
track
PageView
Event
();
// Set active discussion immediately.
// This will ensure that, if a note is specified in the URL hash,
...
...
@@ -274,7 +275,7 @@ export default {
query
:
this
.
$route
.
query
,
});
},
trackEvent
()
{
track
PageView
Event
()
{
// TODO: This needs to be made aware of referers, or if it's rendered in a different context than a Issue
trackDesignDetailView
(
'
issue-design-collection
'
,
...
...
@@ -282,6 +283,10 @@ export default {
this
.
$route
.
query
.
version
||
this
.
latestVersionId
,
this
.
isLatestVersion
,
);
if
(
this
.
glFeatures
.
usageDataDesignAction
)
{
usagePingDesignDetailView
();
}
},
updateActiveDiscussion
(
id
,
source
=
ACTIVE_DISCUSSION_SOURCE_TYPES
.
discussion
)
{
this
.
$apollo
.
mutate
({
...
...
app/assets/javascripts/design_management/utils/tracking.js
View file @
17114e5f
import
Tracking
from
'
~/tracking
'
;
import
api
from
'
~/api
'
;
//
Tracking C
onstants
//
Snowplow tracking c
onstants
const
DESIGN_TRACKING_CONTEXT_SCHEMAS
=
{
VIEW_DESIGN_SCHEMA
:
'
iglu:com.gitlab/design_management_context/jsonschema/1-0-0
'
,
};
...
...
@@ -10,8 +11,14 @@ const DESIGN_TRACKING_EVENTS = {
UPDATE_DESIGN
:
'
update_design
'
,
};
// Usage ping tracking constants
const
DESIGN_ACTION
=
'
design_action
'
;
export
const
DESIGN_TRACKING_PAGE_NAME
=
'
projects:issues:design
'
;
/**
* Track "design detail" view in Snowplow
*/
export
function
trackDesignDetailView
(
referer
=
''
,
owner
=
''
,
...
...
@@ -19,6 +26,7 @@ export function trackDesignDetailView(
latestVersion
=
false
,
)
{
const
eventName
=
DESIGN_TRACKING_EVENTS
.
VIEW_DESIGN
;
Tracking
.
event
(
DESIGN_TRACKING_PAGE_NAME
,
eventName
,
{
label
:
eventName
,
context
:
{
...
...
@@ -40,3 +48,10 @@ export function trackDesignCreate() {
export
function
trackDesignUpdate
()
{
return
Tracking
.
event
(
DESIGN_TRACKING_PAGE_NAME
,
DESIGN_TRACKING_EVENTS
.
UPDATE_DESIGN
);
}
/**
* Track "design detail" view via usage ping
*/
export
function
usagePingDesignDetailView
()
{
api
.
trackRedisHllUserEvent
(
DESIGN_ACTION
);
}
changelogs/unreleased/fe-design0view-usage-ping.yml
0 → 100644
View file @
17114e5f
---
title
:
Capture design detail views via usage ping
merge_request
:
46751
author
:
type
:
added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment