Commit d360a3c8 authored by Tyler Williams's avatar Tyler Williams Committed by David O'Regan

Add import project GTM events to combined form

parent 1b74e49d
...@@ -150,7 +150,7 @@ export const trackSaasTrialProject = () => { ...@@ -150,7 +150,7 @@ export const trackSaasTrialProject = () => {
}); });
}; };
export const trackSaasTrialProjectImport = () => { export const trackProjectImport = () => {
if (!isSupported()) { if (!isSupported()) {
return; return;
} }
...@@ -159,7 +159,7 @@ export const trackSaasTrialProjectImport = () => { ...@@ -159,7 +159,7 @@ export const trackSaasTrialProjectImport = () => {
importButtons.forEach((button) => { importButtons.forEach((button) => {
button.addEventListener('click', () => { button.addEventListener('click', () => {
const { platform } = button.dataset; const { platform } = button.dataset;
pushEvent('saasTrialProjectImport', { saasProjectImport: platform }); pushEvent('projectImport', { platform });
}); });
}); });
}; };
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
import mountComponents from 'ee/registrations/groups_projects/new'; import mountComponents from 'ee/registrations/groups_projects/new';
import Group from '~/group'; import Group from '~/group';
import { trackCombinedGroupProjectForm } from '~/google_tag_manager'; import { trackCombinedGroupProjectForm, trackProjectImport } from '~/google_tag_manager';
new Group(); new Group();
mountComponents(); mountComponents();
trackCombinedGroupProjectForm(); trackCombinedGroupProjectForm();
trackProjectImport();
import initProjectVisibilitySelector from '~/projects/project_visibility'; import initProjectVisibilitySelector from '~/projects/project_visibility';
import initProjectNew from '~/projects/project_new'; import initProjectNew from '~/projects/project_new';
import { trackSaasTrialProject, trackSaasTrialProjectImport } from '~/google_tag_manager'; import { trackSaasTrialProject, trackProjectImport } from '~/google_tag_manager';
initProjectVisibilitySelector(); initProjectVisibilitySelector();
initProjectNew.bindEvents(); initProjectNew.bindEvents();
trackSaasTrialProject(); trackSaasTrialProject();
trackSaasTrialProjectImport(); trackProjectImport();
...@@ -3,12 +3,12 @@ import { v4 as uuidv4 } from 'uuid'; ...@@ -3,12 +3,12 @@ import { v4 as uuidv4 } from 'uuid';
import { import {
trackCombinedGroupProjectForm, trackCombinedGroupProjectForm,
trackFreeTrialAccountSubmissions, trackFreeTrialAccountSubmissions,
trackProjectImport,
trackNewRegistrations, trackNewRegistrations,
trackSaasTrialSubmit, trackSaasTrialSubmit,
trackSaasTrialSkip, trackSaasTrialSkip,
trackSaasTrialGroup, trackSaasTrialGroup,
trackSaasTrialProject, trackSaasTrialProject,
trackSaasTrialProjectImport,
trackSaasTrialGetStarted, trackSaasTrialGetStarted,
trackCheckout, trackCheckout,
trackTransaction, trackTransaction,
...@@ -150,20 +150,20 @@ describe('~/google_tag_manager/index', () => { ...@@ -150,20 +150,20 @@ describe('~/google_tag_manager/index', () => {
createTestCase(trackSaasTrialProject, { createTestCase(trackSaasTrialProject, {
forms: [{ id: 'new_project', expectation: { event: 'saasTrialProject' } }], forms: [{ id: 'new_project', expectation: { event: 'saasTrialProject' } }],
}), }),
createTestCase(trackSaasTrialProjectImport, { createTestCase(trackProjectImport, {
links: [ links: [
{ {
id: 'js-test-btn-0', id: 'js-test-btn-0',
cls: 'js-import-project-btn', cls: 'js-import-project-btn',
attributes: { 'data-platform': 'bitbucket' }, attributes: { 'data-platform': 'bitbucket' },
expectation: { event: 'saasTrialProjectImport', saasProjectImport: 'bitbucket' }, expectation: { event: 'projectImport', platform: 'bitbucket' },
}, },
{ {
// id is neeeded so we trigger the right element in the test // id is neeeded so we trigger the right element in the test
id: 'js-test-btn-1', id: 'js-test-btn-1',
cls: 'js-import-project-btn', cls: 'js-import-project-btn',
attributes: { 'data-platform': 'github' }, attributes: { 'data-platform': 'github' },
expectation: { event: 'saasTrialProjectImport', saasProjectImport: 'github' }, expectation: { event: 'projectImport', platform: 'github' },
}, },
], ],
}), }),
......
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