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
d8ef01c0
Commit
d8ef01c0
authored
Jan 12, 2022
by
Tyler Williams
Committed by
Doug Stull
Jan 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update saasTrialGroup gtm event to capture trial form
parent
8ed313d2
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
4 deletions
+26
-4
app/assets/javascripts/google_tag_manager/index.js
app/assets/javascripts/google_tag_manager/index.js
+1
-1
ee/app/assets/javascripts/pages/trials/select/index.js
ee/app/assets/javascripts/pages/trials/select/index.js
+3
-0
ee/app/controllers/trials_controller.rb
ee/app/controllers/trials_controller.rb
+1
-0
ee/app/views/registrations/groups/new.html.haml
ee/app/views/registrations/groups/new.html.haml
+1
-1
ee/app/views/trials/select.html.haml
ee/app/views/trials/select.html.haml
+1
-1
ee/spec/features/google_analytics_datalayer_spec.rb
ee/spec/features/google_analytics_datalayer_spec.rb
+18
-0
spec/frontend/google_tag_manager/index_spec.js
spec/frontend/google_tag_manager/index_spec.js
+1
-1
No files found.
app/assets/javascripts/google_tag_manager/index.js
View file @
d8ef01c0
...
@@ -82,7 +82,7 @@ export const trackSaasTrialGroup = () => {
...
@@ -82,7 +82,7 @@ export const trackSaasTrialGroup = () => {
return
;
return
;
}
}
const
form
=
document
.
getElementById
(
'
new_
group
'
);
const
form
=
document
.
querySelector
(
'
.js-saas-trial-
group
'
);
form
.
addEventListener
(
'
submit
'
,
()
=>
{
form
.
addEventListener
(
'
submit
'
,
()
=>
{
pushEvent
(
'
saasTrialGroup
'
);
pushEvent
(
'
saasTrialGroup
'
);
});
});
...
...
ee/app/assets/javascripts/pages/trials/select/index.js
View file @
d8ef01c0
import
'
ee/trials/namespace_select
'
;
import
'
ee/trials/namespace_select
'
;
import
{
trackSaasTrialGroup
}
from
'
~/google_tag_manager
'
;
trackSaasTrialGroup
();
ee/app/controllers/trials_controller.rb
View file @
d8ef01c0
...
@@ -26,6 +26,7 @@ class TrialsController < ApplicationController
...
@@ -26,6 +26,7 @@ class TrialsController < ApplicationController
def
select
def
select
experiment
(
:trial_registration_with_reassurance
,
actor:
current_user
)
experiment
(
:trial_registration_with_reassurance
,
actor:
current_user
)
.
track
(
:render
,
label:
'trials:select'
,
user:
current_user
)
.
track
(
:render
,
label:
'trials:select'
,
user:
current_user
)
push_frontend_feature_flag
(
:gitlab_gtm_datalayer
,
type: :ops
)
end
end
def
create_lead
def
create_lead
...
...
ee/app/views/registrations/groups/new.html.haml
View file @
d8ef01c0
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#progress-bar
#progress-bar
%h2
.center
=
_
(
'Create your group'
)
%h2
.center
=
_
(
'Create your group'
)
%p
=
_
(
'A group represents your organization in GitLab. Groups allow you to manage users and collaborate across multiple projects.'
)
%p
=
_
(
'A group represents your organization in GitLab. Groups allow you to manage users and collaborate across multiple projects.'
)
=
form_for
@group
,
url:
users_sign_up_groups_path
(
form_params
),
html:
{
class:
'gl-show-field-errors card gl-w-full gl-p-4'
}
do
|
f
|
=
form_for
@group
,
url:
users_sign_up_groups_path
(
form_params
),
html:
{
class:
'gl-show-field-errors card gl-w-full gl-p-4
js-saas-trial-group
'
}
do
|
f
|
=
form_errors
(
@group
)
=
form_errors
(
@group
)
=
render
'layouts/flash'
=
render
'layouts/flash'
.row
.row
...
...
ee/app/views/trials/select.html.haml
View file @
d8ef01c0
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
=
render
'errors'
=
render
'errors'
=
form_tag
apply_trials_path
(
glm_params
),
method: :post
do
=
form_tag
apply_trials_path
(
glm_params
),
method: :post
,
class:
'js-saas-trial-group'
do
-
if
show_trial_namespace_select?
-
if
show_trial_namespace_select?
.form-group.gl-select2-html5-required-fix
.form-group.gl-select2-html5-required-fix
=
label_tag
:namespace_id
,
_
(
'This subscription is for'
),
for: :namespace_id
,
class:
'col-form-label'
=
label_tag
:namespace_id
,
_
(
'This subscription is for'
),
for: :namespace_id
,
class:
'col-form-label'
...
...
ee/spec/features/google_analytics_datalayer_spec.rb
View file @
d8ef01c0
...
@@ -87,6 +87,24 @@ RSpec.describe 'GitLab.com Google Analytics DataLayer', :js do
...
@@ -87,6 +87,24 @@ RSpec.describe 'GitLab.com Google Analytics DataLayer', :js do
end
end
end
end
context
'on trial group select page'
do
it
'tracks create group events'
do
sign_in
user
visit
select_trials_path
evaluate_script
(
'document.querySelector(".js-saas-trial-group").addEventListener("submit", e => e.preventDefault())'
)
fill_in
'new_group_name'
,
with:
group
.
name
find
(
'#trial_entity_company'
).
click
click_button
'Start your free trial'
data_layer
=
execute_script
(
'return window.dataLayer'
)
last_event_in_data_layer
=
data_layer
[
-
1
]
expect
(
last_event_in_data_layer
[
"event"
]).
to
eq
(
"saasTrialGroup"
)
end
end
context
'on new registration groups page'
do
context
'on new registration groups page'
do
it
'tracks saasTrialGroup events in the dataLayer'
do
it
'tracks saasTrialGroup events in the dataLayer'
do
sign_in
user
sign_in
user
...
...
spec/frontend/google_tag_manager/index_spec.js
View file @
d8ef01c0
...
@@ -142,7 +142,7 @@ describe('~/google_tag_manager/index', () => {
...
@@ -142,7 +142,7 @@ describe('~/google_tag_manager/index', () => {
links
:
[{
cls
:
'
js-skip-trial
'
,
expectation
:
{
event
:
'
saasTrialSkip
'
}
}],
links
:
[{
cls
:
'
js-skip-trial
'
,
expectation
:
{
event
:
'
saasTrialSkip
'
}
}],
}),
}),
createTestCase
(
trackSaasTrialGroup
,
{
createTestCase
(
trackSaasTrialGroup
,
{
forms
:
[{
id
:
'
new_
group
'
,
expectation
:
{
event
:
'
saasTrialGroup
'
}
}],
forms
:
[{
cls
:
'
js-saas-trial-
group
'
,
expectation
:
{
event
:
'
saasTrialGroup
'
}
}],
}),
}),
createTestCase
(
trackSaasTrialProject
,
{
createTestCase
(
trackSaasTrialProject
,
{
forms
:
[{
id
:
'
new_project
'
,
expectation
:
{
event
:
'
saasTrialProject
'
}
}],
forms
:
[{
id
:
'
new_project
'
,
expectation
:
{
event
:
'
saasTrialProject
'
}
}],
...
...
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