mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-18 09:29:24 +00:00
pixel changes
This commit is contained in:
parent
c36d63c6db
commit
4a8994d2e8
@ -169,7 +169,8 @@
|
|||||||
<link rel="stylesheet" th:href="@{'/css/bootstrap-icons.min.css'}">
|
<link rel="stylesheet" th:href="@{'/css/bootstrap-icons.min.css'}">
|
||||||
|
|
||||||
<!-- Pixel, doesn't collect any PII-->
|
<!-- Pixel, doesn't collect any PII-->
|
||||||
<div th:if="${!@disablePixel and @analyticsEnabled}" id="pixel-tracker-container" style="display: none;"></div>
|
<img th:if="${!@disablePixel and @analyticsEnabled}" id="pixel-tracker" referrerpolicy="no-referrer-when-downgrade"
|
||||||
|
style="position: absolute; visibility: hidden; display: none;" />
|
||||||
|
|
||||||
<!-- Custom -->
|
<!-- Custom -->
|
||||||
<link rel="stylesheet" th:href="@{'/css/general.css'}">
|
<link rel="stylesheet" th:href="@{'/css/general.css'}">
|
||||||
@ -220,29 +221,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function UpdatePixelConsent(){
|
function UpdatePixelConsent(){
|
||||||
const pixelContainer = document.getElementById('pixel-tracker-container');
|
const pixelTracker = document.getElementById('pixel-tracker');
|
||||||
if(!pixelContainer) {
|
if(!pixelTracker) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(window.CookieConsent.acceptedCategory('analytics')) {
|
if(window.CookieConsent.acceptedCategory('analytics')) {
|
||||||
// Only create and load the pixel if consent is given and it hasn't been loaded yet
|
// Only set the src if consent is given and it hasn't been loaded yet
|
||||||
if(pixelContainer.children.length === 0) {
|
if(!pixelTracker.src) {
|
||||||
const pixelImg = document.createElement('img');
|
pixelTracker.src = 'https://pixel.stirlingpdf.com/a.png?x-pxid=4f5fa02f-a065-4efb-bb2c-24509a4b6b92'
|
||||||
pixelImg.referrerPolicy = 'no-referrer-when-downgrade';
|
|
||||||
pixelImg.src = 'https://pixel.stirlingpdf.com/a.png?x-pxid=4f5fa02f-a065-4efb-bb2c-24509a4b6b92'
|
|
||||||
+ '&machineType=' + /*[[${@machineType}]]*/ ''
|
+ '&machineType=' + /*[[${@machineType}]]*/ ''
|
||||||
+ '&appVersion=' + /*[[${@appVersion}]]*/ ''
|
+ '&appVersion=' + /*[[${@appVersion}]]*/ ''
|
||||||
+ '&licenseType=' + /*[[${@license}]]*/ ''
|
+ '&licenseType=' + /*[[${@license}]]*/ ''
|
||||||
+ '&loginEnabled=' + /*[[${@loginEnabled}]]*/ '';
|
+ '&loginEnabled=' + /*[[${@loginEnabled}]]*/ '';
|
||||||
pixelImg.style.cssText = 'position: absolute; visibility: hidden;';
|
|
||||||
pixelContainer.appendChild(pixelImg);
|
|
||||||
}
|
}
|
||||||
pixelContainer.style.display = 'block';
|
pixelTracker.style.display = 'block';
|
||||||
} else {
|
} else {
|
||||||
pixelContainer.style.display = 'none';
|
pixelTracker.style.display = 'none';
|
||||||
// Remove pixel image to prevent any tracking
|
// Remove src to prevent any tracking
|
||||||
pixelContainer.innerHTML = '';
|
pixelTracker.src = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const stirlingPDFLabel = /*[[${@StirlingPDFLabel}]]*/ '';
|
const stirlingPDFLabel = /*[[${@StirlingPDFLabel}]]*/ '';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user