diff --git a/src/utils.ts b/src/utils.ts index 6027178..bf1a12a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -17,7 +17,7 @@ export function initializeAdClient(options: ModuleOptions) { return createScriptMeta( `adsbygoogle.onload = function() { adsbygoogle.pauseAdRequests=${options.pauseOnLoad ? '1' : '0'}; - [].forEach.call(document.getElementsByClassName('adsbygoogle'), function() { adsbygoogle.push(${adsenseScript}); }) + [].forEach.call(document.querySelectorAll("ins.adsbygoogle[data-ad-client='${options.id}']"), function() { adsbygoogle.push(${adsenseScript}); }) };`) }