Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
snac
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
snac
snac
Commits
2efbd713
Commit
2efbd713
authored
Jul 31, 2023
by
Jason Jordan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send outbound link events to GA4
parent
1fcb7ac0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
scripts.js
src/virtualhosts/www/javascript/scripts.js
+3
-5
No files found.
src/virtualhosts/www/javascript/scripts.js
View file @
2efbd713
...
...
@@ -257,11 +257,9 @@ function trackOutboundRepoLinks() {
// Send Outbound link clicks to Google Analytics for logging
function
handleOutboundLinkClicks
(
event
)
{
if
(
typeof
ga
===
"function"
)
{
// check for Google Analytics
ga
(
'send'
,
'event'
,
{
eventCategory
:
'Outbound Link'
,
eventAction
:
'click'
,
eventLabel
:
event
.
target
.
href
if
(
typeof
gtag
===
"function"
)
{
// check for Google Analytics 4
gtag
(
'event'
,
'outbound_repo_link'
,
{
'holding_repo_url'
:
event
.
target
.
href
});
}
...
...
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