factorial-pixel 0.7.7 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/__tests__/pixelUrl.spec.js +12 -0
- package/__tests__/requestParameters.spec.js +13 -0
- package/build/app.js +12 -4
- package/coverage/clover.xml +31 -28
- package/coverage/coverage-final.json +3 -3
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/index.js.html +1 -1
- package/coverage/lcov-report/pixelUrl.js.html +23 -11
- package/coverage/lcov-report/requestParameters.js.html +27 -15
- package/coverage/lcov.info +44 -39
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -53,4 +53,16 @@ describe('pixelUrl', () => {
|
|
|
53
53
|
)
|
|
54
54
|
})
|
|
55
55
|
})
|
|
56
|
+
|
|
57
|
+
describe('with fbclid', () => {
|
|
58
|
+
it('returns the data', () => {
|
|
59
|
+
html = "<!DOCTYPE html><html lang='es'></html>"
|
|
60
|
+
dom = new JSDOM(html, {
|
|
61
|
+
url: 'https://staging.factorialhr.es/blog?fbclid=123'
|
|
62
|
+
})
|
|
63
|
+
expect(pixelUrl(dom.window.document)).toEqual(
|
|
64
|
+
'/internal/pixel?mc=&referer=&language=es&landing_page=https://staging.factorialhr.es/blog&fbclid=123'
|
|
65
|
+
)
|
|
66
|
+
})
|
|
67
|
+
})
|
|
56
68
|
})
|
|
@@ -17,6 +17,11 @@ const domWithAclid = new JSDOM(html, {
|
|
|
17
17
|
referrer: 'https://google.com?query=cómo hacer nóminas'
|
|
18
18
|
})
|
|
19
19
|
|
|
20
|
+
const domWithFbclid = new JSDOM(html, {
|
|
21
|
+
url: 'https://factorialhr.com/team/césar?fbclid=123',
|
|
22
|
+
referrer: 'https://google.com?query=cómo hacer nóminas'
|
|
23
|
+
})
|
|
24
|
+
|
|
20
25
|
describe('requestParameters', () => {
|
|
21
26
|
it('returns the data', () => {
|
|
22
27
|
expect(requestParameters(dom.window.document)).toEqual({
|
|
@@ -40,4 +45,12 @@ describe('requestParameters', () => {
|
|
|
40
45
|
aclid: '123'
|
|
41
46
|
})
|
|
42
47
|
})
|
|
48
|
+
|
|
49
|
+
it('returns the data with fbclid', () => {
|
|
50
|
+
expect(requestParameters(domWithFbclid.window.document)).toEqual({
|
|
51
|
+
landingPage: 'https://factorialhr.com/team/c%25C3%25A9sar',
|
|
52
|
+
language: 'en',
|
|
53
|
+
fbclid: '123'
|
|
54
|
+
})
|
|
55
|
+
})
|
|
43
56
|
})
|
package/build/app.js
CHANGED
|
@@ -118,11 +118,12 @@ exports.default = function (document) {
|
|
|
118
118
|
var _requestParameters = (0, _requestParameters3.default)(document),
|
|
119
119
|
language = _requestParameters.language,
|
|
120
120
|
landingPage = _requestParameters.landingPage,
|
|
121
|
+
mc = _requestParameters.mc,
|
|
121
122
|
gclid = _requestParameters.gclid,
|
|
122
|
-
aclid = _requestParameters.aclid
|
|
123
|
+
aclid = _requestParameters.aclid,
|
|
124
|
+
fbclid = _requestParameters.fbclid;
|
|
123
125
|
|
|
124
|
-
var
|
|
125
|
-
var attributes = ['mc=' + (mc ? mc[1] : ''), 'referer=' + encodeURI(document.referrer), 'language=' + language, 'landing_page=' + landingPage];
|
|
126
|
+
var attributes = ['mc=' + (mc || ''), 'referer=' + encodeURI(document.referrer), 'language=' + language, 'landing_page=' + landingPage];
|
|
126
127
|
|
|
127
128
|
if (gclid) {
|
|
128
129
|
attributes.push('gclid=' + gclid);
|
|
@@ -130,6 +131,9 @@ exports.default = function (document) {
|
|
|
130
131
|
if (aclid) {
|
|
131
132
|
attributes.push('aclid=' + aclid);
|
|
132
133
|
}
|
|
134
|
+
if (fbclid) {
|
|
135
|
+
attributes.push('fbclid=' + fbclid);
|
|
136
|
+
}
|
|
133
137
|
|
|
134
138
|
return '/internal/pixel?' + attributes.join('&');
|
|
135
139
|
};
|
|
@@ -171,14 +175,18 @@ function requestParameters(document) {
|
|
|
171
175
|
var search = document.location.search.substring(1);
|
|
172
176
|
var landing = encodeURI(path);
|
|
173
177
|
var locale = document.querySelector('html').lang.split('-')[0];
|
|
178
|
+
var mc = findPropertyInParams(search, 'mc');
|
|
174
179
|
var gclid = findPropertyInParams(search, 'gclid');
|
|
175
180
|
var aclid = findPropertyInParams(search, 'aclid');
|
|
181
|
+
var fbclid = findPropertyInParams(search, 'fbclid');
|
|
176
182
|
|
|
177
183
|
return {
|
|
178
184
|
language: locale,
|
|
179
185
|
landingPage: landing,
|
|
186
|
+
mc: mc,
|
|
180
187
|
gclid: gclid,
|
|
181
|
-
aclid: aclid
|
|
188
|
+
aclid: aclid,
|
|
189
|
+
fbclid: fbclid
|
|
182
190
|
};
|
|
183
191
|
}
|
|
184
192
|
|
package/coverage/clover.xml
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
4
|
-
<metrics statements="
|
|
5
|
-
<file name="index.js" path="/Users/
|
|
2
|
+
<coverage generated="1742571471694" clover="3.2.0">
|
|
3
|
+
<project timestamp="1742571471694" name="All files">
|
|
4
|
+
<metrics statements="33" coveredstatements="23" conditionals="17" coveredconditionals="8" methods="5" coveredmethods="4" elements="55" coveredelements="35" complexity="0" loc="33" ncloc="33" packages="1" files="3" classes="3">
|
|
5
|
+
<file name="index.js" path="/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/index.js">
|
|
6
6
|
<metrics statements="10" coveredstatements="0" conditionals="8" coveredconditionals="0" methods="1" coveredmethods="0"/>
|
|
7
7
|
<line num="1" count="0" type="cond" truecount="0" falsecount="4"/>
|
|
8
8
|
<line num="9" count="0" type="stmt"/>
|
|
@@ -15,31 +15,34 @@
|
|
|
15
15
|
<line num="17" count="0" type="stmt"/>
|
|
16
16
|
<line num="18" count="0" type="stmt"/>
|
|
17
17
|
</file>
|
|
18
|
-
<file name="pixelUrl.js" path="/Users/
|
|
19
|
-
<metrics statements="
|
|
20
|
-
<line num="4" count="
|
|
21
|
-
<line num="
|
|
22
|
-
<line num="
|
|
23
|
-
<line num="
|
|
24
|
-
<line num="
|
|
25
|
-
<line num="
|
|
26
|
-
<line num="
|
|
27
|
-
<line num="
|
|
18
|
+
<file name="pixelUrl.js" path="/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/pixelUrl.js">
|
|
19
|
+
<metrics statements="9" coveredstatements="9" conditionals="8" coveredconditionals="8" methods="1" coveredmethods="1"/>
|
|
20
|
+
<line num="4" count="5" type="stmt"/>
|
|
21
|
+
<line num="7" count="5" type="stmt"/>
|
|
22
|
+
<line num="14" count="5" type="cond" truecount="2" falsecount="0"/>
|
|
23
|
+
<line num="15" count="1" type="stmt"/>
|
|
24
|
+
<line num="17" count="5" type="cond" truecount="2" falsecount="0"/>
|
|
25
|
+
<line num="18" count="1" type="stmt"/>
|
|
26
|
+
<line num="20" count="5" type="cond" truecount="2" falsecount="0"/>
|
|
27
|
+
<line num="21" count="1" type="stmt"/>
|
|
28
|
+
<line num="24" count="5" type="stmt"/>
|
|
28
29
|
</file>
|
|
29
|
-
<file name="requestParameters.js" path="/Users/
|
|
30
|
-
<metrics statements="
|
|
31
|
-
<line num="2" count="
|
|
32
|
-
<line num="4" count="
|
|
33
|
-
<line num="5" count="
|
|
34
|
-
<line num="7" count="
|
|
35
|
-
<line num="10" count="
|
|
36
|
-
<line num="14" count="
|
|
37
|
-
<line num="15" count="
|
|
38
|
-
<line num="16" count="
|
|
39
|
-
<line num="17" count="
|
|
40
|
-
<line num="18" count="
|
|
41
|
-
<line num="19" count="
|
|
42
|
-
<line num="
|
|
30
|
+
<file name="requestParameters.js" path="/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/requestParameters.js">
|
|
31
|
+
<metrics statements="14" coveredstatements="14" conditionals="1" coveredconditionals="0" methods="3" coveredmethods="3"/>
|
|
32
|
+
<line num="2" count="36" type="stmt"/>
|
|
33
|
+
<line num="4" count="36" type="stmt"/>
|
|
34
|
+
<line num="5" count="36" type="stmt"/>
|
|
35
|
+
<line num="7" count="36" type="stmt"/>
|
|
36
|
+
<line num="10" count="36" type="stmt"/>
|
|
37
|
+
<line num="14" count="9" type="stmt"/>
|
|
38
|
+
<line num="15" count="9" type="stmt"/>
|
|
39
|
+
<line num="16" count="9" type="stmt"/>
|
|
40
|
+
<line num="17" count="9" type="stmt"/>
|
|
41
|
+
<line num="18" count="9" type="stmt"/>
|
|
42
|
+
<line num="19" count="9" type="stmt"/>
|
|
43
|
+
<line num="20" count="9" type="stmt"/>
|
|
44
|
+
<line num="21" count="9" type="stmt"/>
|
|
45
|
+
<line num="23" count="9" type="stmt"/>
|
|
43
46
|
</file>
|
|
44
47
|
</metrics>
|
|
45
48
|
</project>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{"/Users/
|
|
2
|
-
,"/Users/
|
|
3
|
-
,"/Users/
|
|
1
|
+
{"/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/index.js": {"path":"/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/index.js","statementMap":{"0":{"start":{"line":1,"column":29},"end":{"line":1,"column":50}},"1":{"start":{"line":1,"column":68},"end":{"line":1,"column":101}},"2":{"start":{"line":1,"column":140},"end":{"line":1,"column":194}},"3":{"start":{"line":9,"column":13},"end":{"line":9,"column":55}},"4":{"start":{"line":10,"column":19},"end":{"line":10,"column":69}},"5":{"start":{"line":11,"column":13},"end":{"line":11,"column":58}},"6":{"start":{"line":13,"column":10},"end":{"line":13,"column":39}},"7":{"start":{"line":14,"column":0},"end":{"line":14,"column":58}},"8":{"start":{"line":15,"column":0},"end":{"line":15,"column":14}},"9":{"start":{"line":16,"column":0},"end":{"line":16,"column":15}},"10":{"start":{"line":17,"column":0},"end":{"line":17,"column":28}},"11":{"start":{"line":18,"column":0},"end":{"line":18,"column":31}}},"fnMap":{"0":{"name":"_interopRequireDefault","decl":{"start":{"line":1,"column":111},"end":{"line":1,"column":133}},"loc":{"start":{"line":1,"column":139},"end":{"line":1,"column":195}},"line":1}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":147},"end":{"line":1,"column":193}},"type":"cond-expr","locations":[{"start":{"line":1,"column":171},"end":{"line":1,"column":174}},{"start":{"line":1,"column":177},"end":{"line":1,"column":193}}],"line":1},"1":{"loc":{"start":{"line":1,"column":147},"end":{"line":1,"column":168}},"type":"binary-expr","locations":[{"start":{"line":1,"column":147},"end":{"line":1,"column":150}},{"start":{"line":1,"column":154},"end":{"line":1,"column":168}}],"line":1},"2":{"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":69}},"type":"cond-expr","locations":[{"start":{"line":10,"column":28},"end":{"line":10,"column":62}},{"start":{"line":10,"column":65},"end":{"line":10,"column":69}}],"line":10},"3":{"loc":{"start":{"line":11,"column":13},"end":{"line":11,"column":58}},"type":"binary-expr","locations":[{"start":{"line":11,"column":13},"end":{"line":11,"column":25}},{"start":{"line":11,"column":29},"end":{"line":11,"column":58}}],"line":11}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"f":{"0":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0]}}
|
|
2
|
+
,"/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/pixelUrl.js": {"path":"/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/pixelUrl.js","statementMap":{"0":{"start":{"line":4,"column":62},"end":{"line":6,"column":3}},"1":{"start":{"line":7,"column":21},"end":{"line":12,"column":3}},"2":{"start":{"line":14,"column":2},"end":{"line":16,"column":3}},"3":{"start":{"line":15,"column":4},"end":{"line":15,"column":37}},"4":{"start":{"line":17,"column":2},"end":{"line":19,"column":3}},"5":{"start":{"line":18,"column":4},"end":{"line":18,"column":37}},"6":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"7":{"start":{"line":21,"column":4},"end":{"line":21,"column":39}},"8":{"start":{"line":24,"column":2},"end":{"line":24,"column":50}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":15},"end":{"line":3,"column":16}},"loc":{"start":{"line":3,"column":27},"end":{"line":25,"column":1}},"line":3}},"branchMap":{"0":{"loc":{"start":{"line":8,"column":10},"end":{"line":8,"column":18}},"type":"binary-expr","locations":[{"start":{"line":8,"column":10},"end":{"line":8,"column":12}},{"start":{"line":8,"column":16},"end":{"line":8,"column":18}}],"line":8},"1":{"loc":{"start":{"line":14,"column":2},"end":{"line":16,"column":3}},"type":"if","locations":[{"start":{"line":14,"column":2},"end":{"line":16,"column":3}},{"start":{"line":14,"column":2},"end":{"line":16,"column":3}}],"line":14},"2":{"loc":{"start":{"line":17,"column":2},"end":{"line":19,"column":3}},"type":"if","locations":[{"start":{"line":17,"column":2},"end":{"line":19,"column":3}},{"start":{"line":17,"column":2},"end":{"line":19,"column":3}}],"line":17},"3":{"loc":{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},"type":"if","locations":[{"start":{"line":20,"column":2},"end":{"line":22,"column":3}},{"start":{"line":20,"column":2},"end":{"line":22,"column":3}}],"line":20}},"s":{"0":5,"1":5,"2":5,"3":1,"4":5,"5":1,"6":5,"7":1,"8":5},"f":{"0":5},"b":{"0":[5,4],"1":[1,4],"2":[1,4],"3":[1,4]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"431f708a3117c179b747c0079aa9031af787f4e2"}
|
|
3
|
+
,"/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/requestParameters.js": {"path":"/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/requestParameters.js","statementMap":{"0":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}},"1":{"start":{"line":4,"column":2},"end":{"line":8,"column":4}},"2":{"start":{"line":5,"column":25},"end":{"line":5,"column":41}},"3":{"start":{"line":7,"column":4},"end":{"line":7,"column":20}},"4":{"start":{"line":10,"column":2},"end":{"line":10,"column":22}},"5":{"start":{"line":14,"column":15},"end":{"line":14,"column":68}},"6":{"start":{"line":15,"column":17},"end":{"line":15,"column":54}},"7":{"start":{"line":16,"column":18},"end":{"line":16,"column":33}},"8":{"start":{"line":17,"column":17},"end":{"line":17,"column":66}},"9":{"start":{"line":18,"column":13},"end":{"line":18,"column":47}},"10":{"start":{"line":19,"column":16},"end":{"line":19,"column":53}},"11":{"start":{"line":20,"column":16},"end":{"line":20,"column":53}},"12":{"start":{"line":21,"column":17},"end":{"line":21,"column":55}},"13":{"start":{"line":23,"column":2},"end":{"line":30,"column":3}}},"fnMap":{"0":{"name":"findPropertyInParams","decl":{"start":{"line":1,"column":9},"end":{"line":1,"column":29}},"loc":{"start":{"line":1,"column":54},"end":{"line":11,"column":1}},"line":1},"1":{"name":"(anonymous_1)","decl":{"start":{"line":4,"column":28},"end":{"line":4,"column":29}},"loc":{"start":{"line":4,"column":37},"end":{"line":8,"column":3}},"line":4},"2":{"name":"requestParameters","decl":{"start":{"line":13,"column":24},"end":{"line":13,"column":41}},"loc":{"start":{"line":13,"column":53},"end":{"line":31,"column":1}},"line":13}},"branchMap":{"0":{"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":42}},"type":"default-arg","locations":[{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}],"line":1}},"s":{"0":36,"1":36,"2":36,"3":36,"4":36,"5":9,"6":9,"7":9,"8":9,"9":9,"10":9,"11":9,"12":9,"13":9},"f":{"0":36,"1":36,"2":9},"b":{"0":[0]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"e870f71eba13519a427b56e88ff2c9247c1863ab"}
|
|
4
4
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
var jumpToCode = (function init() {
|
|
3
|
+
// Classes of code we would like to highlight in the file view
|
|
4
|
+
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
|
|
5
|
+
|
|
6
|
+
// Elements to highlight in the file listing view
|
|
7
|
+
var fileListingElements = ['td.pct.low'];
|
|
8
|
+
|
|
9
|
+
// We don't want to select elements that are direct descendants of another match
|
|
10
|
+
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
|
|
11
|
+
|
|
12
|
+
// Selecter that finds elements on the page to which we can jump
|
|
13
|
+
var selector =
|
|
14
|
+
fileListingElements.join(', ') +
|
|
15
|
+
', ' +
|
|
16
|
+
notSelector +
|
|
17
|
+
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
|
|
18
|
+
|
|
19
|
+
// The NodeList of matching elements
|
|
20
|
+
var missingCoverageElements = document.querySelectorAll(selector);
|
|
21
|
+
|
|
22
|
+
var currentIndex;
|
|
23
|
+
|
|
24
|
+
function toggleClass(index) {
|
|
25
|
+
missingCoverageElements
|
|
26
|
+
.item(currentIndex)
|
|
27
|
+
.classList.remove('highlighted');
|
|
28
|
+
missingCoverageElements.item(index).classList.add('highlighted');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function makeCurrent(index) {
|
|
32
|
+
toggleClass(index);
|
|
33
|
+
currentIndex = index;
|
|
34
|
+
missingCoverageElements.item(index).scrollIntoView({
|
|
35
|
+
behavior: 'smooth',
|
|
36
|
+
block: 'center',
|
|
37
|
+
inline: 'center'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function goToPrevious() {
|
|
42
|
+
var nextIndex = 0;
|
|
43
|
+
if (typeof currentIndex !== 'number' || currentIndex === 0) {
|
|
44
|
+
nextIndex = missingCoverageElements.length - 1;
|
|
45
|
+
} else if (missingCoverageElements.length > 1) {
|
|
46
|
+
nextIndex = currentIndex - 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
makeCurrent(nextIndex);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function goToNext() {
|
|
53
|
+
var nextIndex = 0;
|
|
54
|
+
|
|
55
|
+
if (
|
|
56
|
+
typeof currentIndex === 'number' &&
|
|
57
|
+
currentIndex < missingCoverageElements.length - 1
|
|
58
|
+
) {
|
|
59
|
+
nextIndex = currentIndex + 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
makeCurrent(nextIndex);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return function jump(event) {
|
|
66
|
+
if (
|
|
67
|
+
document.getElementById('fileSearch') === document.activeElement &&
|
|
68
|
+
document.activeElement != null
|
|
69
|
+
) {
|
|
70
|
+
// if we're currently focused on the search input, we don't want to navigate
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
switch (event.which) {
|
|
75
|
+
case 78: // n
|
|
76
|
+
case 74: // j
|
|
77
|
+
goToNext();
|
|
78
|
+
break;
|
|
79
|
+
case 66: // b
|
|
80
|
+
case 75: // k
|
|
81
|
+
case 80: // p
|
|
82
|
+
goToPrevious();
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
})();
|
|
87
|
+
window.addEventListener('keydown', jumpToCode);
|
|
Binary file
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
</div><!-- /wrapper -->
|
|
84
84
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
85
85
|
Code coverage
|
|
86
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
86
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Mar 21 2025 16:37:51 GMT+0100 (Central European Standard Time)
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
89
89
|
<script src="prettify.js"></script>
|
|
@@ -83,7 +83,7 @@ const img <span class="cstat-no" title="statement not covered" >= document.creat
|
|
|
83
83
|
</div><!-- /wrapper -->
|
|
84
84
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
85
85
|
Code coverage
|
|
86
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
86
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Mar 21 2025 16:37:51 GMT+0100 (Central European Standard Time)
|
|
87
87
|
</div>
|
|
88
88
|
</div>
|
|
89
89
|
<script src="prettify.js"></script>
|
|
@@ -44,34 +44,43 @@
|
|
|
44
44
|
19
|
|
45
45
|
20
|
|
46
46
|
21
|
|
47
|
-
22
|
|
47
|
+
22
|
|
48
|
+
23
|
|
49
|
+
24
|
|
50
|
+
25
|
|
51
|
+
26</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
48
52
|
<span class="cline-any cline-neutral"> </span>
|
|
49
53
|
<span class="cline-any cline-neutral"> </span>
|
|
50
|
-
<span class="cline-any cline-yes">
|
|
51
|
-
<span class="cline-any cline-yes">4x</span>
|
|
52
|
-
<span class="cline-any cline-yes">4x</span>
|
|
54
|
+
<span class="cline-any cline-yes">5x</span>
|
|
53
55
|
<span class="cline-any cline-neutral"> </span>
|
|
54
56
|
<span class="cline-any cline-neutral"> </span>
|
|
57
|
+
<span class="cline-any cline-yes">5x</span>
|
|
55
58
|
<span class="cline-any cline-neutral"> </span>
|
|
56
59
|
<span class="cline-any cline-neutral"> </span>
|
|
57
60
|
<span class="cline-any cline-neutral"> </span>
|
|
58
61
|
<span class="cline-any cline-neutral"> </span>
|
|
59
|
-
<span class="cline-any cline-
|
|
62
|
+
<span class="cline-any cline-neutral"> </span>
|
|
63
|
+
<span class="cline-any cline-neutral"> </span>
|
|
64
|
+
<span class="cline-any cline-yes">5x</span>
|
|
60
65
|
<span class="cline-any cline-yes">1x</span>
|
|
61
66
|
<span class="cline-any cline-neutral"> </span>
|
|
62
|
-
<span class="cline-any cline-yes">
|
|
67
|
+
<span class="cline-any cline-yes">5x</span>
|
|
63
68
|
<span class="cline-any cline-yes">1x</span>
|
|
64
69
|
<span class="cline-any cline-neutral"> </span>
|
|
70
|
+
<span class="cline-any cline-yes">5x</span>
|
|
71
|
+
<span class="cline-any cline-yes">1x</span>
|
|
65
72
|
<span class="cline-any cline-neutral"> </span>
|
|
66
|
-
<span class="cline-any cline-
|
|
73
|
+
<span class="cline-any cline-neutral"> </span>
|
|
74
|
+
<span class="cline-any cline-yes">5x</span>
|
|
67
75
|
<span class="cline-any cline-neutral"> </span>
|
|
68
76
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import requestParameters from './requestParameters'
|
|
69
77
|
|
|
70
78
|
export default document => {
|
|
71
|
-
const { language, landingPage, gclid, aclid } = requestParameters(
|
|
72
|
-
|
|
79
|
+
const { language, landingPage, mc, gclid, aclid, fbclid } = requestParameters(
|
|
80
|
+
document
|
|
81
|
+
)
|
|
73
82
|
const attributes = [
|
|
74
|
-
`mc=${mc
|
|
83
|
+
`mc=${mc || ''}`,
|
|
75
84
|
`referer=${encodeURI(document.referrer)}`,
|
|
76
85
|
`language=${language}`,
|
|
77
86
|
`landing_page=${landingPage}`
|
|
@@ -83,6 +92,9 @@ export default document => {
|
|
|
83
92
|
if (aclid) {
|
|
84
93
|
attributes.push(`aclid=${aclid}`)
|
|
85
94
|
}
|
|
95
|
+
if (fbclid) {
|
|
96
|
+
attributes.push(`fbclid=${fbclid}`)
|
|
97
|
+
}
|
|
86
98
|
|
|
87
99
|
return `/internal/pixel?${attributes.join('&')}`
|
|
88
100
|
}
|
|
@@ -92,7 +104,7 @@ export default document => {
|
|
|
92
104
|
</div><!-- /wrapper -->
|
|
93
105
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
94
106
|
Code coverage
|
|
95
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
107
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Mar 21 2025 16:37:51 GMT+0100 (Central European Standard Time)
|
|
96
108
|
</div>
|
|
97
109
|
</div>
|
|
98
110
|
<script src="prettify.js"></script>
|
|
@@ -50,27 +50,35 @@
|
|
|
50
50
|
25
|
|
51
51
|
26
|
|
52
52
|
27
|
|
53
|
-
28
|
|
54
|
-
|
|
53
|
+
28
|
|
54
|
+
29
|
|
55
|
+
30
|
|
56
|
+
31
|
|
57
|
+
32</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
58
|
+
<span class="cline-any cline-yes">36x</span>
|
|
55
59
|
<span class="cline-any cline-neutral"> </span>
|
|
56
|
-
<span class="cline-any cline-yes">
|
|
57
|
-
<span class="cline-any cline-yes">
|
|
60
|
+
<span class="cline-any cline-yes">36x</span>
|
|
61
|
+
<span class="cline-any cline-yes">36x</span>
|
|
58
62
|
<span class="cline-any cline-neutral"> </span>
|
|
59
|
-
<span class="cline-any cline-yes">
|
|
63
|
+
<span class="cline-any cline-yes">36x</span>
|
|
60
64
|
<span class="cline-any cline-neutral"> </span>
|
|
61
65
|
<span class="cline-any cline-neutral"> </span>
|
|
62
|
-
<span class="cline-any cline-yes">
|
|
66
|
+
<span class="cline-any cline-yes">36x</span>
|
|
63
67
|
<span class="cline-any cline-neutral"> </span>
|
|
64
68
|
<span class="cline-any cline-neutral"> </span>
|
|
65
69
|
<span class="cline-any cline-neutral"> </span>
|
|
66
|
-
<span class="cline-any cline-yes">
|
|
67
|
-
<span class="cline-any cline-yes">
|
|
68
|
-
<span class="cline-any cline-yes">
|
|
69
|
-
<span class="cline-any cline-yes">
|
|
70
|
-
<span class="cline-any cline-yes">
|
|
71
|
-
<span class="cline-any cline-yes">
|
|
70
|
+
<span class="cline-any cline-yes">9x</span>
|
|
71
|
+
<span class="cline-any cline-yes">9x</span>
|
|
72
|
+
<span class="cline-any cline-yes">9x</span>
|
|
73
|
+
<span class="cline-any cline-yes">9x</span>
|
|
74
|
+
<span class="cline-any cline-yes">9x</span>
|
|
75
|
+
<span class="cline-any cline-yes">9x</span>
|
|
76
|
+
<span class="cline-any cline-yes">9x</span>
|
|
77
|
+
<span class="cline-any cline-yes">9x</span>
|
|
78
|
+
<span class="cline-any cline-neutral"> </span>
|
|
79
|
+
<span class="cline-any cline-yes">9x</span>
|
|
80
|
+
<span class="cline-any cline-neutral"> </span>
|
|
72
81
|
<span class="cline-any cline-neutral"> </span>
|
|
73
|
-
<span class="cline-any cline-yes">7x</span>
|
|
74
82
|
<span class="cline-any cline-neutral"> </span>
|
|
75
83
|
<span class="cline-any cline-neutral"> </span>
|
|
76
84
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -94,14 +102,18 @@ export default function requestParameters (document) {
|
|
|
94
102
|
const search = document.location.search.substring(1)
|
|
95
103
|
const landing = encodeURI(path)
|
|
96
104
|
const locale = document.querySelector('html').lang.split('-')[0]
|
|
105
|
+
const mc = findPropertyInParams(search, 'mc')
|
|
97
106
|
const gclid = findPropertyInParams(search, 'gclid')
|
|
98
107
|
const aclid = findPropertyInParams(search, 'aclid')
|
|
108
|
+
const fbclid = findPropertyInParams(search, 'fbclid')
|
|
99
109
|
|
|
100
110
|
return {
|
|
101
111
|
language: locale,
|
|
102
112
|
landingPage: landing,
|
|
113
|
+
mc,
|
|
103
114
|
gclid,
|
|
104
|
-
aclid
|
|
115
|
+
aclid,
|
|
116
|
+
fbclid
|
|
105
117
|
}
|
|
106
118
|
}
|
|
107
119
|
</pre></td></tr>
|
|
@@ -110,7 +122,7 @@ export default function requestParameters (document) {
|
|
|
110
122
|
</div><!-- /wrapper -->
|
|
111
123
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
112
124
|
Code coverage
|
|
113
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
125
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Mar 21 2025 16:37:51 GMT+0100 (Central European Standard Time)
|
|
114
126
|
</div>
|
|
115
127
|
</div>
|
|
116
128
|
<script src="prettify.js"></script>
|
package/coverage/lcov.info
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
TN:
|
|
2
|
-
SF:/Users/
|
|
2
|
+
SF:/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/index.js
|
|
3
3
|
FN:1,_interopRequireDefault
|
|
4
4
|
FNF:1
|
|
5
5
|
FNH:0
|
|
@@ -28,54 +28,59 @@ BRF:8
|
|
|
28
28
|
BRH:0
|
|
29
29
|
end_of_record
|
|
30
30
|
TN:
|
|
31
|
-
SF:/Users/
|
|
31
|
+
SF:/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/pixelUrl.js
|
|
32
32
|
FN:3,(anonymous_0)
|
|
33
33
|
FNF:1
|
|
34
34
|
FNH:1
|
|
35
|
-
FNDA:
|
|
36
|
-
DA:4,
|
|
37
|
-
DA:5
|
|
38
|
-
DA:
|
|
39
|
-
DA:
|
|
40
|
-
DA:
|
|
41
|
-
DA:
|
|
42
|
-
DA:
|
|
43
|
-
DA:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
BRDA:
|
|
48
|
-
BRDA:
|
|
49
|
-
BRDA:
|
|
50
|
-
BRDA:
|
|
51
|
-
BRDA:
|
|
52
|
-
|
|
53
|
-
|
|
35
|
+
FNDA:5,(anonymous_0)
|
|
36
|
+
DA:4,5
|
|
37
|
+
DA:7,5
|
|
38
|
+
DA:14,5
|
|
39
|
+
DA:15,1
|
|
40
|
+
DA:17,5
|
|
41
|
+
DA:18,1
|
|
42
|
+
DA:20,5
|
|
43
|
+
DA:21,1
|
|
44
|
+
DA:24,5
|
|
45
|
+
LF:9
|
|
46
|
+
LH:9
|
|
47
|
+
BRDA:8,0,0,5
|
|
48
|
+
BRDA:8,0,1,4
|
|
49
|
+
BRDA:14,1,0,1
|
|
50
|
+
BRDA:14,1,1,4
|
|
51
|
+
BRDA:17,2,0,1
|
|
52
|
+
BRDA:17,2,1,4
|
|
53
|
+
BRDA:20,3,0,1
|
|
54
|
+
BRDA:20,3,1,4
|
|
55
|
+
BRF:8
|
|
56
|
+
BRH:8
|
|
54
57
|
end_of_record
|
|
55
58
|
TN:
|
|
56
|
-
SF:/Users/
|
|
59
|
+
SF:/Users/marc-penche-factorial/Documents/GitHub/factorial-pixel/src/requestParameters.js
|
|
57
60
|
FN:1,findPropertyInParams
|
|
58
61
|
FN:4,(anonymous_1)
|
|
59
62
|
FN:13,requestParameters
|
|
60
63
|
FNF:3
|
|
61
64
|
FNH:3
|
|
62
|
-
FNDA:
|
|
63
|
-
FNDA:
|
|
64
|
-
FNDA:
|
|
65
|
-
DA:2,
|
|
66
|
-
DA:4,
|
|
67
|
-
DA:5,
|
|
68
|
-
DA:7,
|
|
69
|
-
DA:10,
|
|
70
|
-
DA:14,
|
|
71
|
-
DA:15,
|
|
72
|
-
DA:16,
|
|
73
|
-
DA:17,
|
|
74
|
-
DA:18,
|
|
75
|
-
DA:19,
|
|
76
|
-
DA:
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
FNDA:36,findPropertyInParams
|
|
66
|
+
FNDA:36,(anonymous_1)
|
|
67
|
+
FNDA:9,requestParameters
|
|
68
|
+
DA:2,36
|
|
69
|
+
DA:4,36
|
|
70
|
+
DA:5,36
|
|
71
|
+
DA:7,36
|
|
72
|
+
DA:10,36
|
|
73
|
+
DA:14,9
|
|
74
|
+
DA:15,9
|
|
75
|
+
DA:16,9
|
|
76
|
+
DA:17,9
|
|
77
|
+
DA:18,9
|
|
78
|
+
DA:19,9
|
|
79
|
+
DA:20,9
|
|
80
|
+
DA:21,9
|
|
81
|
+
DA:23,9
|
|
82
|
+
LF:14
|
|
83
|
+
LH:14
|
|
79
84
|
BRDA:1,0,0,0
|
|
80
85
|
BRF:1
|
|
81
86
|
BRH:0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "factorial-pixel",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"description": "Factorial marketing pixel",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,12 +35,13 @@
|
|
|
35
35
|
"babel-register": "^6.24.1",
|
|
36
36
|
"eslint": "^4.18.2",
|
|
37
37
|
"eslint-config-standard": "^10.2.1",
|
|
38
|
-
"eslint-plugin-import": "^2.
|
|
38
|
+
"eslint-plugin-import": "^2.29.1",
|
|
39
39
|
"eslint-plugin-node": "^5.0.0",
|
|
40
40
|
"eslint-plugin-promise": "^3.5.0",
|
|
41
41
|
"eslint-plugin-standard": "^3.0.1",
|
|
42
42
|
"husky": "^0.13.4",
|
|
43
43
|
"jest": "^20.0.4",
|
|
44
|
+
"jest-jasmine2": "^29.7.0",
|
|
44
45
|
"jsdom": "11.0.0",
|
|
45
46
|
"lint-staged": "^3.6.0",
|
|
46
47
|
"prettier-standard": "^5.0.0",
|