DEPARTMENT OF TRADE INDUSTRY AND COMPETITION
the dti Customer Contact Centre
Working Hours: Monday – Friday, from 08h00 until 17h00
National callers: 0861 843 384 - International callers: +27 (12) 394 9500
E-mail: contactus@thedti.gov.za
National faxes: Send to 0861 843 888 - International faxes: Send to +27 (12) 394 9501
Physical: the dti, 77 Meintjies Street, Sunnyside, Pretoria, Gauteng, 0002
Postal: the dti, Private Bag X84, Pretoria, Gauteng, 0001
Courier: the dti, 12 Robert Sobukwe, Sunnyside, Pretoria, Gauteng, 0002
document.addEventListener("DOMContentLoaded", function() {
var adsenseLoadTriggered = false;
// 1. Function to load the main AdSense SDK
function loadAdSenseSDK() {
if (adsenseLoadTriggered) return;
var script = document.createElement("script");
script.async = true;
script.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4986925452700064";
script.crossOrigin = "anonymous";
document.head.appendChild(script);
adsenseLoadTriggered = true;
}
// 2. Setup the Observer
var adObserver = new IntersectionObserver(function(entries, observer) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
// User is close to the ad!
loadAdSenseSDK(); // Ensure SDK is there
(adsbygoogle = window.adsbygoogle || []).push({}); // Trigger this specific ad
observer.unobserve(entry.target); // Stop watching this ad
}
});
}, { rootMargin: "200px" }); // Starts loading 200px before it enters view
// 3. Attach observer to all ad units
document.querySelectorAll(".adsbygoogle").forEach(function(ad) {
adObserver.observe(ad);
});
});