@tilli-pro/cookieconsent-plugin 0.7.91 → 0.7.92
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/.cache/tsbuildinfo.json +1 -1
- package/demos/demo.html +2 -2
- package/demos/demo.min.html +1 -1
- package/demos/demo.styles.dark.html +2 -2
- package/demos/demo.styles.dark.min.html +1 -1
- package/demos/demo.styles.nudge-website.dark.html +2 -2
- package/demos/demo.styles.nudge-website.dark.min.html +1 -1
- package/demos/demo.styles.nudge-website.light.html +2 -2
- package/demos/demo.styles.nudge-website.light.min.html +1 -1
- package/demos/demo.styles.nudge.dark.html +2 -2
- package/demos/demo.styles.nudge.dark.min.html +1 -1
- package/demos/demo.styles.nudge.light.html +2 -2
- package/demos/demo.styles.nudge.light.min.html +1 -1
- package/demos/demo.styles.tenant_con-edison.dark.html +2 -2
- package/demos/demo.styles.tenant_con-edison.dark.min.html +1 -1
- package/demos/demo.styles.tenant_con-edison.light.html +2 -2
- package/demos/demo.styles.tenant_con-edison.light.min.html +1 -1
- package/demos/demo.styles.tenant_freeman.dark.html +2 -2
- package/demos/demo.styles.tenant_freeman.dark.min.html +1 -1
- package/demos/demo.styles.tenant_freeman.light.html +2 -2
- package/demos/demo.styles.tenant_freeman.light.min.html +1 -1
- package/demos/demo.styles.tenant_frontier.dark.html +2 -2
- package/demos/demo.styles.tenant_frontier.dark.min.html +1 -1
- package/demos/demo.styles.tenant_frontier.light.html +2 -2
- package/demos/demo.styles.tenant_frontier.light.min.html +1 -1
- package/demos/demo.styles.tenant_oru.dark.html +2 -2
- package/demos/demo.styles.tenant_oru.dark.min.html +1 -1
- package/demos/demo.styles.tenant_oru.light.html +2 -2
- package/demos/demo.styles.tenant_oru.light.min.html +1 -1
- package/demos/demo.styles.tilli-pay.dark.html +2 -2
- package/demos/demo.styles.tilli-pay.dark.min.html +1 -1
- package/demos/demo.styles.tilli-pay.light.html +2 -2
- package/demos/demo.styles.tilli-pay.light.min.html +1 -1
- package/demos/demo.styles.tilli-website.dark.html +2 -2
- package/demos/demo.styles.tilli-website.dark.min.html +1 -1
- package/demos/demo.styles.tilli-website.light.html +2 -2
- package/demos/demo.styles.tilli-website.light.min.html +1 -1
- package/dist/config/gui-options/scripts/injectUTM.d.ts.map +1 -1
- package/dist/config/gui-options/scripts/injectUTM.js +6 -3
- package/dist/init.d.ts +1 -1
- package/dist/init.js +2 -2
- package/package.json +1 -1
- package/src/config/gui-options/scripts/injectUTM.ts +13 -8
- package/src/init.ts +2 -2
@@ -54,7 +54,10 @@ const A_TAG_IDS_TO_INJECT_UTM_PARAMETERS = [
|
|
54
54
|
"tilli-cc-privacy-policy-link-preferences",
|
55
55
|
];
|
56
56
|
|
57
|
-
export const injectUTMParametersIntoATags = (
|
57
|
+
export const injectUTMParametersIntoATags = (
|
58
|
+
maxAttempts = Infinity, // handle edge case where the a tags are not yet loaded (e.g., for the preferences modal)
|
59
|
+
attempt = 1,
|
60
|
+
) => {
|
58
61
|
const _preferences = {
|
59
62
|
...DEFAULT_UTM_PARAMETERS,
|
60
63
|
source: new URL(window.location.href).hostname, // use the hostname of the current page as the source
|
@@ -80,7 +83,7 @@ export const injectUTMParametersIntoATags = (maxAttempts = 30, attempt = 1) => {
|
|
80
83
|
setTimeout(
|
81
84
|
() => injectUTMParametersIntoATags(maxAttempts, attempt + 1),
|
82
85
|
1_000,
|
83
|
-
);
|
86
|
+
);
|
84
87
|
};
|
85
88
|
|
86
89
|
/**
|
@@ -101,12 +104,14 @@ export const addUTMParameters = (
|
|
101
104
|
);
|
102
105
|
|
103
106
|
// add new parameters
|
104
|
-
Object.entries(parameters)
|
105
|
-
(
|
106
|
-
|
107
|
-
value
|
108
|
-
|
109
|
-
|
107
|
+
Object.entries(parameters)
|
108
|
+
.sort((a, b) => a[0].localeCompare(b[0])) // sort alphabetically by key (to ensure consistent order)
|
109
|
+
.forEach(
|
110
|
+
([key, value]) =>
|
111
|
+
!!value &&
|
112
|
+
value !== "unknown" &&
|
113
|
+
url.searchParams.set(`utm_${key}`, value),
|
114
|
+
);
|
110
115
|
|
111
116
|
return url;
|
112
117
|
};
|
package/src/init.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import "https://cdn.jsdelivr.net/gh/tilli-pro/cookieconsent@
|
1
|
+
import "https://cdn.jsdelivr.net/gh/tilli-pro/cookieconsent@db17994543047dd69ff56e082568e7eb83316061/dist/cookieconsent.umd.js";
|
2
2
|
|
3
3
|
import type * as _CookieConsent from "@tilli-pro/cookieconsent";
|
4
4
|
import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
|
@@ -18,7 +18,7 @@ declare global {
|
|
18
18
|
}
|
19
19
|
}
|
20
20
|
|
21
|
-
const GIT_SHA = "
|
21
|
+
const GIT_SHA = "db17994543047dd69ff56e082568e7eb83316061";
|
22
22
|
const GIT_REPO = "tilli-pro/cookieconsent";
|
23
23
|
const GIT_CDN_BASE_URL = "https://cdn.jsdelivr.net/gh";
|
24
24
|
const GIT_CDN_URL = `${GIT_CDN_BASE_URL}/${GIT_REPO}@${GIT_SHA}`;
|