Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advanced_mautic_integration
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
advanced_mautic_integration
Merge requests
!5
Add .gitlab-ci.yml
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add .gitlab-ci.yml
issue/advanced_mautic_integration-3448523:3448523-set-up-cicd
into
1.0.x
Overview
0
Commits
4
Pipelines
5
Changes
11
Merged
Grzegorz Pietrzak
requested to merge
issue/advanced_mautic_integration-3448523:3448523-set-up-cicd
into
1.0.x
1 year ago
Overview
0
Commits
4
Pipelines
5
Changes
11
Expand
Closes
#3448523
0
0
Merge request reports
Compare
1.0.x
version 3
a2f7f682
1 year ago
version 2
7dd459c3
1 year ago
version 1
2897fafd
1 year ago
1.0.x (base)
and
latest version
latest version
1ae43ce8
4 commits,
1 year ago
version 3
a2f7f682
3 commits,
1 year ago
version 2
7dd459c3
2 commits,
1 year ago
version 1
2897fafd
1 commit,
1 year ago
11 files
+
65
−
31
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
11
Search (e.g. *.vue) (Ctrl+P)
js/tracking_events.js
+
20
−
20
Options
@@ -5,7 +5,7 @@
/* global mt */
(
Drupal
=>
{
(
(
Drupal
)
=>
{
/**
* This array contains all pageviews that have been sent to Mautic.
* This is used to prevent duplicate pageviews in one request.
@@ -36,40 +36,40 @@
const
params
=
settings
.
advancedMauticIntegration
.
trackDefaultParameters
;
Object
.
assign
(
params
,
extraParams
);
if
(
typeof
mt
===
"
function
"
)
{
mt
(
"
send
"
,
"
pageview
"
,
params
);
if
(
typeof
mt
===
'
function
'
)
{
mt
(
'
send
'
,
'
pageview
'
,
params
);
}
Drupal
.
mt_pageviews
.
push
(
url
);
}
};
const
isInternal
=
url
=>
{
const
isInternal
=
(
url
)
=>
{
const
isInternalRegex
=
new
RegExp
(
`^(https?)://
${
window
.
location
.
host
}
`
,
"
i
"
'
i
'
,
);
return
isInternalRegex
.
test
(
url
);
};
const
isDownload
=
url
=>
{
const
isDownload
=
(
url
)
=>
{
const
isDownloadRegex
=
new
RegExp
(
`
\\
.(
${
settings
.
advancedMauticIntegration
.
trackDownloadExtensions
}
)([?#].*)?$`
,
"
i
"
'
i
'
,
);
return
isDownloadRegex
.
test
(
url
);
};
const
isMailto
=
url
=>
{
const
isMailto
=
(
url
)
=>
{
const
isInternalRegex
=
/^mailto:/i
;
return
isInternalRegex
.
test
(
url
);
};
const
isTel
=
url
=>
{
const
isTel
=
(
url
)
=>
{
const
isInternalRegex
=
/^tel:/i
;
return
isInternalRegex
.
test
(
url
);
};
const
isProperExternal
=
url
=>
{
const
isProperExternal
=
(
url
)
=>
{
const
isProperExternalRegex
=
/^
\w
+:
\/\/
/i
;
return
isProperExternalRegex
.
test
(
url
);
};
@@ -80,8 +80,8 @@
}
// Bind events to <a> tags.
once
(
"
bind-mautic-tracking
"
,
"
a
"
,
context
).
forEach
(
el
=>
{
const
trackLink
=
event
=>
{
once
(
'
bind-mautic-tracking
'
,
'
a
'
,
context
).
forEach
(
(
el
)
=>
{
const
trackLink
=
(
event
)
=>
{
const
url
=
event
.
target
.
href
;
if
(
isInternal
(
url
))
{
@@ -90,7 +90,7 @@
Drupal
.
mt_send
({
page_url
:
url
,
page_title
:
`Download
${
url
}
`
,
referrer
:
window
.
location
.
href
referrer
:
window
.
location
.
href
,
});
}
}
@@ -99,7 +99,7 @@
Drupal
.
mt_send
({
page_url
:
url
,
page_title
:
`Mail to:
${
url
.
substr
(
7
)}
`
,
referrer
:
window
.
location
.
href
referrer
:
window
.
location
.
href
,
});
}
}
else
if
(
isTel
(
url
))
{
@@ -107,7 +107,7 @@
Drupal
.
mt_send
({
page_url
:
url
,
page_title
:
`Phone:
${
url
.
substr
(
5
)}
`
,
referrer
:
window
.
location
.
href
referrer
:
window
.
location
.
href
,
});
}
}
else
if
(
@@ -117,15 +117,15 @@
Drupal
.
mt_send
({
page_url
:
url
,
page_title
:
`External link:
${
url
}
`
,
referrer
:
window
.
location
.
href
referrer
:
window
.
location
.
href
,
});
}
};
el
.
addEventListener
(
"
mousedown
"
,
trackLink
);
el
.
addEventListener
(
"
keyup
"
,
trackLink
);
el
.
addEventListener
(
"
touchstart
"
,
trackLink
);
el
.
addEventListener
(
'
mousedown
'
,
trackLink
);
el
.
addEventListener
(
'
keyup
'
,
trackLink
);
el
.
addEventListener
(
'
touchstart
'
,
trackLink
);
});
}
}
,
};
})(
Drupal
);
Loading