@adobe/alloy 2.30.1-beta.11 → 2.30.1-beta.12
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/libEs5/components/Context/createComponent.js +1 -2
- package/libEs5/components/Context/implementationDetails.js +7 -9
- package/libEs5/components/Context/index.js +4 -1
- package/libEs5/components/Context/injectDevice.js +2 -2
- package/libEs5/components/Context/injectEnvironment.js +2 -2
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +2 -2
- package/libEs5/components/Context/injectOneTimeAnalyticsReferrer.js +49 -0
- package/libEs5/components/Context/injectPlaceContext.js +2 -2
- package/libEs5/components/Context/injectTimestamp.js +2 -3
- package/libEs5/components/Context/injectWeb.js +9 -11
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs6/components/Context/createComponent.js +1 -2
- package/libEs6/components/Context/implementationDetails.js +7 -9
- package/libEs6/components/Context/index.js +4 -1
- package/libEs6/components/Context/injectDevice.js +3 -3
- package/libEs6/components/Context/injectEnvironment.js +3 -3
- package/libEs6/components/Context/injectHighEntropyUserAgentHints.js +3 -3
- package/libEs6/components/Context/injectOneTimeAnalyticsReferrer.js +46 -0
- package/libEs6/components/Context/injectPlaceContext.js +3 -3
- package/libEs6/components/Context/injectTimestamp.js +2 -3
- package/libEs6/components/Context/injectWeb.js +9 -11
- package/libEs6/constants/libraryVersion.js +1 -1
- package/package.json +1 -1
- package/types/components/Context/createComponent.d.ts +1 -1
- package/types/components/Context/createComponent.d.ts.map +1 -1
- package/types/components/Context/implementationDetails.d.ts +1 -1
- package/types/components/Context/implementationDetails.d.ts.map +1 -1
- package/types/components/Context/index.d.ts +1 -1
- package/types/components/Context/index.d.ts.map +1 -1
- package/types/components/Context/injectDevice.d.ts +1 -1
- package/types/components/Context/injectDevice.d.ts.map +1 -1
- package/types/components/Context/injectEnvironment.d.ts +1 -1
- package/types/components/Context/injectEnvironment.d.ts.map +1 -1
- package/types/components/Context/injectHighEntropyUserAgentHints.d.ts +1 -1
- package/types/components/Context/injectHighEntropyUserAgentHints.d.ts.map +1 -1
- package/types/components/Context/injectOneTimeAnalyticsReferrer.d.ts +3 -0
- package/types/components/Context/injectOneTimeAnalyticsReferrer.d.ts.map +1 -0
- package/types/components/Context/injectPlaceContext.d.ts +1 -1
- package/types/components/Context/injectPlaceContext.d.ts.map +1 -1
- package/types/components/Context/injectTimestamp.d.ts +1 -1
- package/types/components/Context/injectTimestamp.d.ts.map +1 -1
- package/types/components/Context/injectWeb.d.ts +1 -1
- package/types/components/Context/injectWeb.d.ts.map +1 -1
|
@@ -27,8 +27,7 @@ var _default = (config, logger, optionalContexts, requiredContexts) => {
|
|
|
27
27
|
onBeforeEvent({
|
|
28
28
|
event
|
|
29
29
|
}) {
|
|
30
|
-
|
|
31
|
-
return Promise.all(contexts.map(context => Promise.resolve(context(xdm, logger)))).then(() => event.mergeXdm(xdm));
|
|
30
|
+
return Promise.all(contexts.map(context => Promise.resolve(context(event, logger))));
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
var _index = require("../../utils/index.js");
|
|
5
4
|
var _libraryName = require("../../constants/libraryName.js");
|
|
6
5
|
var _libraryVersion = require("../../constants/libraryVersion.js");
|
|
7
6
|
/*
|
|
@@ -15,14 +14,13 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
15
14
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
15
|
governing permissions and limitations under the License.
|
|
17
16
|
*/
|
|
18
|
-
var _default =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
implementationDetails
|
|
17
|
+
var _default = event => {
|
|
18
|
+
event.mergeXdm({
|
|
19
|
+
implementationDetails: {
|
|
20
|
+
name: _libraryName.default,
|
|
21
|
+
version: _libraryVersion.default,
|
|
22
|
+
environment: "browser"
|
|
23
|
+
}
|
|
26
24
|
});
|
|
27
25
|
};
|
|
28
26
|
exports.default = _default;
|
|
@@ -9,6 +9,7 @@ var _injectTimestamp = require("./injectTimestamp.js");
|
|
|
9
9
|
var _implementationDetails = require("./implementationDetails.js");
|
|
10
10
|
var _createComponent = require("./createComponent.js");
|
|
11
11
|
var _injectHighEntropyUserAgentHints = require("./injectHighEntropyUserAgentHints.js");
|
|
12
|
+
var _injectOneTimeAnalyticsReferrer = require("./injectOneTimeAnalyticsReferrer.js");
|
|
12
13
|
var _index = require("../../utils/validation/index.js");
|
|
13
14
|
/*
|
|
14
15
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -28,6 +29,7 @@ const environment = (0, _injectEnvironment.default)(window);
|
|
|
28
29
|
const placeContext = (0, _injectPlaceContext.default)(() => new Date());
|
|
29
30
|
const timestamp = (0, _injectTimestamp.default)(() => new Date());
|
|
30
31
|
const highEntropyUserAgentHints = (0, _injectHighEntropyUserAgentHints.default)(navigator);
|
|
32
|
+
const oneTimeAnalyticsReferrer = (0, _injectOneTimeAnalyticsReferrer.default)(window);
|
|
31
33
|
const defaultEnabledContexts = {
|
|
32
34
|
web,
|
|
33
35
|
device,
|
|
@@ -35,7 +37,8 @@ const defaultEnabledContexts = {
|
|
|
35
37
|
placeContext
|
|
36
38
|
};
|
|
37
39
|
const defaultDisabledContexts = {
|
|
38
|
-
highEntropyUserAgentHints
|
|
40
|
+
highEntropyUserAgentHints,
|
|
41
|
+
oneTimeAnalyticsReferrer
|
|
39
42
|
};
|
|
40
43
|
const optionalContexts = {
|
|
41
44
|
...defaultEnabledContexts,
|
|
@@ -44,7 +44,7 @@ const getScreenOrientationViaMediaQuery = window => {
|
|
|
44
44
|
return null;
|
|
45
45
|
};
|
|
46
46
|
var _default = window => {
|
|
47
|
-
return
|
|
47
|
+
return event => {
|
|
48
48
|
const {
|
|
49
49
|
screen: {
|
|
50
50
|
width,
|
|
@@ -65,7 +65,7 @@ var _default = window => {
|
|
|
65
65
|
device.screenOrientation = orientation;
|
|
66
66
|
}
|
|
67
67
|
if (Object.keys(device).length > 0) {
|
|
68
|
-
|
|
68
|
+
event.mergeXdm({
|
|
69
69
|
device
|
|
70
70
|
});
|
|
71
71
|
}
|
|
@@ -14,7 +14,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
var _default = window => {
|
|
17
|
-
return
|
|
17
|
+
return event => {
|
|
18
18
|
const {
|
|
19
19
|
document: {
|
|
20
20
|
documentElement: {
|
|
@@ -37,7 +37,7 @@ var _default = window => {
|
|
|
37
37
|
environment.browserDetails = environment.browserDetails || {};
|
|
38
38
|
environment.browserDetails.viewportHeight = viewportHeight;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
event.mergeXdm({
|
|
41
41
|
environment
|
|
42
42
|
});
|
|
43
43
|
};
|
|
@@ -22,7 +22,7 @@ var _default = navigator => {
|
|
|
22
22
|
if (!browserSupportsUserAgentClientHints(navigator)) {
|
|
23
23
|
return _index.noop;
|
|
24
24
|
}
|
|
25
|
-
return (
|
|
25
|
+
return (event, logger) => {
|
|
26
26
|
try {
|
|
27
27
|
// eslint-disable-next-line compat/compat -- userAgentData support is checked before calling
|
|
28
28
|
return navigator.userAgentData.getHighEntropyValues(_highEntropyUserAgentClientHints.default.map(hint => hint[0])).then(hints => {
|
|
@@ -33,7 +33,7 @@ var _default = navigator => {
|
|
|
33
33
|
userAgentClientHints[hintName] = hints[hintName];
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
|
|
36
|
+
event.mergeXdm({
|
|
37
37
|
environment: {
|
|
38
38
|
browserDetails: {
|
|
39
39
|
userAgentClientHints
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
/*
|
|
5
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
6
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
var _default = window => {
|
|
16
|
+
let lastReferrerSent = null;
|
|
17
|
+
return event => {
|
|
18
|
+
const content = event.getContent();
|
|
19
|
+
const eventType = content.xdm?.eventType;
|
|
20
|
+
if (eventType === "decisioning.propositionFetch") {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Allow customers to explicitly set the referrer (for SPA view changes)
|
|
25
|
+
// Otherwise, use document.referrer
|
|
26
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
27
|
+
const explicitReferrer = content.data?.__adobe?.analytics?.referrer;
|
|
28
|
+
const currentReferrer = explicitReferrer !== undefined ? explicitReferrer : window.document.referrer;
|
|
29
|
+
if (currentReferrer === lastReferrerSent) {
|
|
30
|
+
event.mergeData({
|
|
31
|
+
__adobe: {
|
|
32
|
+
analytics: {
|
|
33
|
+
referrer: ""
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
event.mergeData({
|
|
40
|
+
__adobe: {
|
|
41
|
+
analytics: {
|
|
42
|
+
referrer: currentReferrer
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
lastReferrerSent = currentReferrer;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
exports.default = _default;
|
|
@@ -14,7 +14,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
var _default = dateProvider => {
|
|
17
|
-
return
|
|
17
|
+
return event => {
|
|
18
18
|
const date = dateProvider();
|
|
19
19
|
const placeContext = {};
|
|
20
20
|
const localTimezoneOffset = (0, _index.toInteger)(date.getTimezoneOffset());
|
|
@@ -25,7 +25,7 @@ var _default = dateProvider => {
|
|
|
25
25
|
if (localTimezoneOffset === undefined || Math.abs(localTimezoneOffset) < 6000) {
|
|
26
26
|
placeContext.localTime = (0, _index.toISOStringLocal)(date);
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
event.mergeXdm({
|
|
29
29
|
placeContext
|
|
30
30
|
});
|
|
31
31
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
var _index = require("../../utils/index.js");
|
|
5
4
|
/*
|
|
6
5
|
Copyright 2019 Adobe. All rights reserved.
|
|
7
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -14,9 +13,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
13
|
governing permissions and limitations under the License.
|
|
15
14
|
*/
|
|
16
15
|
var _default = dateProvider => {
|
|
17
|
-
return
|
|
16
|
+
return event => {
|
|
18
17
|
const timestamp = dateProvider().toISOString();
|
|
19
|
-
|
|
18
|
+
event.mergeXdm({
|
|
20
19
|
timestamp
|
|
21
20
|
});
|
|
22
21
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
var _index = require("../../utils/index.js");
|
|
5
4
|
/*
|
|
6
5
|
Copyright 2019 Adobe. All rights reserved.
|
|
7
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -14,17 +13,16 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
13
|
governing permissions and limitations under the License.
|
|
15
14
|
*/
|
|
16
15
|
var _default = window => {
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
return event => {
|
|
17
|
+
event.mergeXdm({
|
|
18
|
+
web: {
|
|
19
|
+
webPageDetails: {
|
|
20
|
+
URL: window.location.href || window.location
|
|
21
|
+
},
|
|
22
|
+
webReferrer: {
|
|
23
|
+
URL: window.document.referrer
|
|
24
|
+
}
|
|
24
25
|
}
|
|
25
|
-
};
|
|
26
|
-
(0, _index.deepAssign)(xdm, {
|
|
27
|
-
web
|
|
28
26
|
});
|
|
29
27
|
};
|
|
30
28
|
};
|
|
@@ -14,4 +14,4 @@ governing permissions and limitations under the License.
|
|
|
14
14
|
*/
|
|
15
15
|
// The __VERSION__ keyword will be replace at alloy build time with the package.json version.
|
|
16
16
|
// see babel-plugin-version
|
|
17
|
-
var _default = exports.default = "2.30.1-beta.
|
|
17
|
+
var _default = exports.default = "2.30.1-beta.12";
|
|
@@ -24,8 +24,7 @@ export default (config, logger, optionalContexts, requiredContexts) => {
|
|
|
24
24
|
onBeforeEvent({
|
|
25
25
|
event
|
|
26
26
|
}) {
|
|
27
|
-
|
|
28
|
-
return Promise.all(contexts.map(context => Promise.resolve(context(xdm, logger)))).then(() => event.mergeXdm(xdm));
|
|
27
|
+
return Promise.all(contexts.map(context => Promise.resolve(context(event, logger))));
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
};
|
|
@@ -9,16 +9,14 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { deepAssign } from "../../utils/index.js";
|
|
13
12
|
import libraryName from "../../constants/libraryName.js";
|
|
14
13
|
import libraryVersion from "../../constants/libraryVersion.js";
|
|
15
|
-
export default
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
implementationDetails
|
|
14
|
+
export default event => {
|
|
15
|
+
event.mergeXdm({
|
|
16
|
+
implementationDetails: {
|
|
17
|
+
name: libraryName,
|
|
18
|
+
version: libraryVersion,
|
|
19
|
+
environment: "browser"
|
|
20
|
+
}
|
|
23
21
|
});
|
|
24
22
|
};
|
|
@@ -18,6 +18,7 @@ import injectTimestamp from "./injectTimestamp.js";
|
|
|
18
18
|
import implementationDetails from "./implementationDetails.js";
|
|
19
19
|
import createComponent from "./createComponent.js";
|
|
20
20
|
import injectHighEntropyUserAgentHints from "./injectHighEntropyUserAgentHints.js";
|
|
21
|
+
import injectOneTimeAnalyticsReferrer from "./injectOneTimeAnalyticsReferrer.js";
|
|
21
22
|
import { arrayOf, objectOf, string } from "../../utils/validation/index.js";
|
|
22
23
|
const web = injectWeb(window);
|
|
23
24
|
const device = injectDevice(window);
|
|
@@ -25,6 +26,7 @@ const environment = injectEnvironment(window);
|
|
|
25
26
|
const placeContext = injectPlaceContext(() => new Date());
|
|
26
27
|
const timestamp = injectTimestamp(() => new Date());
|
|
27
28
|
const highEntropyUserAgentHints = injectHighEntropyUserAgentHints(navigator);
|
|
29
|
+
const oneTimeAnalyticsReferrer = injectOneTimeAnalyticsReferrer(window);
|
|
28
30
|
const defaultEnabledContexts = {
|
|
29
31
|
web,
|
|
30
32
|
device,
|
|
@@ -32,7 +34,8 @@ const defaultEnabledContexts = {
|
|
|
32
34
|
placeContext
|
|
33
35
|
};
|
|
34
36
|
const defaultDisabledContexts = {
|
|
35
|
-
highEntropyUserAgentHints
|
|
37
|
+
highEntropyUserAgentHints,
|
|
38
|
+
oneTimeAnalyticsReferrer
|
|
36
39
|
};
|
|
37
40
|
const optionalContexts = {
|
|
38
41
|
...defaultEnabledContexts,
|
|
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { isFunction, toInteger } from "../../utils/index.js";
|
|
14
14
|
const getScreenOrientationViaProperty = window => {
|
|
15
15
|
const {
|
|
16
16
|
screen: {
|
|
@@ -41,7 +41,7 @@ const getScreenOrientationViaMediaQuery = window => {
|
|
|
41
41
|
return null;
|
|
42
42
|
};
|
|
43
43
|
export default window => {
|
|
44
|
-
return
|
|
44
|
+
return event => {
|
|
45
45
|
const {
|
|
46
46
|
screen: {
|
|
47
47
|
width,
|
|
@@ -62,7 +62,7 @@ export default window => {
|
|
|
62
62
|
device.screenOrientation = orientation;
|
|
63
63
|
}
|
|
64
64
|
if (Object.keys(device).length > 0) {
|
|
65
|
-
|
|
65
|
+
event.mergeXdm({
|
|
66
66
|
device
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -10,9 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { toInteger } from "../../utils/index.js";
|
|
14
14
|
export default window => {
|
|
15
|
-
return
|
|
15
|
+
return event => {
|
|
16
16
|
const {
|
|
17
17
|
document: {
|
|
18
18
|
documentElement: {
|
|
@@ -35,7 +35,7 @@ export default window => {
|
|
|
35
35
|
environment.browserDetails = environment.browserDetails || {};
|
|
36
36
|
environment.browserDetails.viewportHeight = viewportHeight;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
event.mergeXdm({
|
|
39
39
|
environment
|
|
40
40
|
});
|
|
41
41
|
};
|
|
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { noop } from "../../utils/index.js";
|
|
14
14
|
import highEntropyUserAgentHints from "../../constants/highEntropyUserAgentClientHints.js";
|
|
15
15
|
const browserSupportsUserAgentClientHints = navigator => {
|
|
16
16
|
return "userAgentData" in navigator;
|
|
@@ -19,7 +19,7 @@ export default navigator => {
|
|
|
19
19
|
if (!browserSupportsUserAgentClientHints(navigator)) {
|
|
20
20
|
return noop;
|
|
21
21
|
}
|
|
22
|
-
return (
|
|
22
|
+
return (event, logger) => {
|
|
23
23
|
try {
|
|
24
24
|
// eslint-disable-next-line compat/compat -- userAgentData support is checked before calling
|
|
25
25
|
return navigator.userAgentData.getHighEntropyValues(highEntropyUserAgentHints.map(hint => hint[0])).then(hints => {
|
|
@@ -30,7 +30,7 @@ export default navigator => {
|
|
|
30
30
|
userAgentClientHints[hintName] = hints[hintName];
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
event.mergeXdm({
|
|
34
34
|
environment: {
|
|
35
35
|
browserDetails: {
|
|
36
36
|
userAgentClientHints
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default window => {
|
|
14
|
+
let lastReferrerSent = null;
|
|
15
|
+
return event => {
|
|
16
|
+
const content = event.getContent();
|
|
17
|
+
const eventType = content.xdm?.eventType;
|
|
18
|
+
if (eventType === "decisioning.propositionFetch") {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Allow customers to explicitly set the referrer (for SPA view changes)
|
|
23
|
+
// Otherwise, use document.referrer
|
|
24
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
25
|
+
const explicitReferrer = content.data?.__adobe?.analytics?.referrer;
|
|
26
|
+
const currentReferrer = explicitReferrer !== undefined ? explicitReferrer : window.document.referrer;
|
|
27
|
+
if (currentReferrer === lastReferrerSent) {
|
|
28
|
+
event.mergeData({
|
|
29
|
+
__adobe: {
|
|
30
|
+
analytics: {
|
|
31
|
+
referrer: ""
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
event.mergeData({
|
|
38
|
+
__adobe: {
|
|
39
|
+
analytics: {
|
|
40
|
+
referrer: currentReferrer
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
lastReferrerSent = currentReferrer;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -9,9 +9,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import { toISOStringLocal, toInteger } from "../../utils/index.js";
|
|
13
13
|
export default dateProvider => {
|
|
14
|
-
return
|
|
14
|
+
return event => {
|
|
15
15
|
const date = dateProvider();
|
|
16
16
|
const placeContext = {};
|
|
17
17
|
const localTimezoneOffset = toInteger(date.getTimezoneOffset());
|
|
@@ -22,7 +22,7 @@ export default dateProvider => {
|
|
|
22
22
|
if (localTimezoneOffset === undefined || Math.abs(localTimezoneOffset) < 6000) {
|
|
23
23
|
placeContext.localTime = toISOStringLocal(date);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
event.mergeXdm({
|
|
26
26
|
placeContext
|
|
27
27
|
});
|
|
28
28
|
};
|
|
@@ -10,11 +10,10 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { deepAssign } from "../../utils/index.js";
|
|
14
13
|
export default dateProvider => {
|
|
15
|
-
return
|
|
14
|
+
return event => {
|
|
16
15
|
const timestamp = dateProvider().toISOString();
|
|
17
|
-
|
|
16
|
+
event.mergeXdm({
|
|
18
17
|
timestamp
|
|
19
18
|
});
|
|
20
19
|
};
|
|
@@ -10,19 +10,17 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { deepAssign } from "../../utils/index.js";
|
|
14
13
|
export default window => {
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
return event => {
|
|
15
|
+
event.mergeXdm({
|
|
16
|
+
web: {
|
|
17
|
+
webPageDetails: {
|
|
18
|
+
URL: window.location.href || window.location
|
|
19
|
+
},
|
|
20
|
+
webReferrer: {
|
|
21
|
+
URL: window.document.referrer
|
|
22
|
+
}
|
|
22
23
|
}
|
|
23
|
-
};
|
|
24
|
-
deepAssign(xdm, {
|
|
25
|
-
web
|
|
26
24
|
});
|
|
27
25
|
};
|
|
28
26
|
};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/createComponent.js"],"names":[],"mappings":"AAWe;;;;;;;
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/createComponent.js"],"names":[],"mappings":"AAWe;;;;;;;EAuBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementationDetails.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/implementationDetails.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"implementationDetails.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/implementationDetails.js"],"names":[],"mappings":"AAce,4CAQd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/index.js"],"names":[],"mappings":";AA+CA;;;;;;;;;;EAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectDevice.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectDevice.js"],"names":[],"mappings":"AAiDe,yCACL,
|
|
1
|
+
{"version":3,"file":"injectDevice.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectDevice.js"],"names":[],"mappings":"AAiDe,yCACL,UAAK,UA0Bd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectEnvironment.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectEnvironment.js"],"names":[],"mappings":"AAce,yCACL,
|
|
1
|
+
{"version":3,"file":"injectEnvironment.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectEnvironment.js"],"names":[],"mappings":"AAce,yCACL,UAAK,UAsBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectHighEntropyUserAgentHints.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectHighEntropyUserAgentHints.js"],"names":[],"mappings":"AAmBe,
|
|
1
|
+
{"version":3,"file":"injectHighEntropyUserAgentHints.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectHighEntropyUserAgentHints.js"],"names":[],"mappings":"AAmBe,4EAmCd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"injectOneTimeAnalyticsReferrer.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectOneTimeAnalyticsReferrer.js"],"names":[],"mappings":"AAYe,yCAGL,UAAK,UAsCd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectPlaceContext.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectPlaceContext.js"],"names":[],"mappings":"AAae,+CACL,
|
|
1
|
+
{"version":3,"file":"injectPlaceContext.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectPlaceContext.js"],"names":[],"mappings":"AAae,+CACL,UAAK,UAmBd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectTimestamp.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectTimestamp.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"injectTimestamp.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectTimestamp.js"],"names":[],"mappings":"AAYe,+CACL,UAAK,UAId"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectWeb.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectWeb.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"injectWeb.d.ts","sourceRoot":"","sources":["../../../packages/core/src/components/Context/injectWeb.js"],"names":[],"mappings":"AAYe,yCACL,UAAK,UAYd"}
|