09.07.2025 11:22

‘;

// Insert the banner into the container
document.getElementById(containerId).innerHTML = html;
}

// Function to track ad view
function trackAdView(adId) {
var img = new Image();
img.src = ajaxUrl + ‘?action=aw_ads_track_view&ad_id=’ + adId + ‘&r=” + Math.random();
}

// Function to track ad click
window.trackAdClick = function(adId, event) {
// Prevent the default link behavior
if (event) {
event.preventDefault();
}

// Get the link URL from the clicked element
var linkUrl = event.currentTarget.href;

// Track the click
var img = new Image();
img.src = ajaxUrl + “?action=track_ad_click&ad_id=’ + adId + ‘&r=” + Math.random();

// Open the link in a new tab after a small delay
setTimeout(function() {
window.open(linkUrl, “_blank’);
}, 100);

// Return false to prevent the default link click
return false;
};

// Load the banner
loadBanner();
});



‘;

// Insert the banner into the container
document.getElementById(containerId).innerHTML = html;
}

// Function to track ad view
function trackAdView(adId) {
var img = new Image();
img.src = ajaxUrl + ‘?action=aw_ads_track_view&ad_id=’ + adId + ‘&r=” + Math.random();
}

// Function to track ad click
window.trackAdClick = function(adId, event) {
// Prevent the default link behavior
if (event) {
event.preventDefault();
}

// Get the link URL from the clicked element
var linkUrl = event.currentTarget.href;

// Track the click
var img = new Image();
img.src = ajaxUrl + “?action=track_ad_click&ad_id=’ + adId + ‘&r=” + Math.random();

// Open the link in a new tab after a small delay
setTimeout(function() {
window.open(linkUrl, “_blank’);
}, 100);

// Return false to prevent the default link click
return false;
};

// Load the banner
loadBanner();
});