Commit 80e26017 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'rkuba-master-patch-62787' into 'master'

Updated tracking keys based on product feedback

See merge request gitlab-org/gitlab!31629
parents e9500f28 82d6ae29
......@@ -259,8 +259,10 @@ export default {
});
},
trackEvent() {
// 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',
'issue',
this.$route.query.version || this.latestVersionId,
this.isLatestVersion,
);
......
......@@ -4,8 +4,9 @@ function assembleDesignPayload(payloadArr) {
return {
value: {
'internal-object-refrerer': payloadArr[0],
'version-number': payloadArr[1],
'current-version': payloadArr[2],
'design-collection-owner': payloadArr[1],
'design-version-number': payloadArr[2],
'design-is-current-version': payloadArr[3],
},
};
}
......@@ -14,9 +15,14 @@ function assembleDesignPayload(payloadArr) {
const DESIGN_TRACKING_PAGE_NAME = 'projects:issues:design';
// eslint-disable-next-line import/prefer-default-export
export function trackDesignDetailView(refrerer = '', designVersion = 1, latestVersion = false) {
export function trackDesignDetailView(
referer = '',
owner = '',
designVersion = 1,
latestVersion = false,
) {
Tracking.event(DESIGN_TRACKING_PAGE_NAME, 'design_viewed', {
label: 'design_viewed',
...assembleDesignPayload([refrerer, designVersion, latestVersion]),
...assembleDesignPayload([referer, owner, designVersion, latestVersion]),
});
}
......@@ -22,8 +22,9 @@ describe('Tracking Events', () => {
label: eventName,
value: {
'internal-object-refrerer': '',
'version-number': 1,
'current-version': false,
'design-collection-owner': '',
'design-version-number': 1,
'design-is-current-version': false,
},
}),
);
......@@ -32,7 +33,7 @@ describe('Tracking Events', () => {
it('trackDesignDetailView allows to customize the value payload', () => {
const trackingSpy = getTrackingSpy(eventKey);
trackDesignDetailView('from-a-test', 100, true);
trackDesignDetailView('from-a-test', 'test', 100, true);
expect(trackingSpy).toHaveBeenCalledWith(
eventKey,
......@@ -41,8 +42,9 @@ describe('Tracking Events', () => {
label: eventName,
value: {
'internal-object-refrerer': 'from-a-test',
'version-number': 100,
'current-version': true,
'design-collection-owner': 'test',
'design-version-number': 100,
'design-is-current-version': true,
},
}),
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment