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
deb3e2e4
Commit
deb3e2e4
authored
Oct 25, 2019
by
Alex Buijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trigger tracking event without user interaction
parent
8b8c5984
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
app/assets/javascripts/pages/sessions/new/index.js
app/assets/javascripts/pages/sessions/new/index.js
+9
-7
No files found.
app/assets/javascripts/pages/sessions/new/index.js
View file @
deb3e2e4
...
...
@@ -20,12 +20,14 @@ document.addEventListener('DOMContentLoaded', () => {
// Save the URL fragment from the current window location. This will be present if the user was
// redirected to sign-in after attempting to access a protected URL that included a fragment.
preserveUrlFragment
(
window
.
location
.
hash
);
});
if
(
gon
.
tracking_data
)
{
const
tab
=
document
.
querySelector
(
"
.new-session-tabs a[href='#register-pane']
"
);
if
(
gon
.
tracking_data
)
{
const
{
category
,
action
,
...
data
}
=
gon
.
tracking_data
;
tab
.
addEventListener
(
'
click
'
,
()
=>
{
$
(
'
#signin-container a[data-toggle="tab"]
'
).
on
(
'
shown.bs.tab
'
,
e
=>
{
if
(
e
.
target
.
dataset
.
qaSelector
===
'
register_tab
'
)
{
Tracking
.
event
(
category
,
action
,
data
);
});
}
});
});
}
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