Posts tagged with adsense

I have use to AFS based on the documentation, and I have also reference many other websites. I have found that the clicktrackUrl parameter is used in their code, which can trigger click tracking when clicking on an advertisement. However, I did not see this field in the documentation. The reference documentation is as follows:

https://support.google.com/adsense/answer/9055049

Does this field exist? I added this parameter, but it doesn't work on my website. How can I make this parameter work?

Reference website, website url: https://www.jnee.uk/us/strategize-g-suite-project-management-system-work enter image description here

I want use clicktrackUrl parameter to fixed my tracking problom,thank you

I am struggling with implement google native ads on web, i tired to find some documentation on google site, but all refers to mobile app. Has anyone perhaps implemented this?

Already what i do:

  1. I dig through the google documentation
  2. Ask chat GPT :) , give me few useless info
  3. Some tests with google ads events etc.

I'm building a Chrome extension for educational purposes that removes/replaces a GoogleAds div with my custom div.

How do I locate the google-ad divs? Is there a specific id or class associated with it?

This is how I'm injecting my code into the website:--

content-script.js

var div=document.createElement("div"); // is there any specific divID associated with it? document.body.appendChild(div);  div.innerText="test123"; 

EDIT 1

Updating the structure as requested by @rabsom

<div class="q-box qu-pb--small" style="box-sizing: border-box;">    <div class="q-box qu-cursor--pointer dom_annotate_google_ad" id="div-gpt-ad-1633993162946-0-init-a" style="box-sizing: border-box;" data-google-query-id="CNy0k-Dxiv8CFYCFZgId2jkKvA">       <div id="google_ads_iframe_/21680945556/li_stick_home_and_ad_react_0__container__" style="border: 0pt none; margin: auto; text-align: center; width: 300px; height: 250px;">         <iframe frameborder="0" src="https://515625e180dff516c1055c5fa3af1b19.safeframe.googlesyndication.com/safeframe/1-0-40/html/container.html" id="google_ads_iframe_/21680945556/li_stick_home_and_ad_react_0" title="3rd party ad content" name="" scrolling="no" marginwidth="0" marginheight="0" width="300" height="250" data-is-safeframe="true" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" role="region" aria-label="Advertisement" tabindex="0" data-google-container-id="1" style="border: 0px; vertical-align: bottom;" data-load-complete="true"></iframe>       </div>    </div> </div> 

EDIT 2

I'm able to use the googletag now. However, it shows up after the ads have been loaded. So, I wait for the DOM to be loaded completely.

document.addEventListener('readystatechange', event => {     if (event.target.readyState === "complete") {         for (i = 0; i < googletag.pubads().getSlots().length; i++) {             var slotDomId = googletag.pubads().getSlots()[i].getSlotElementId();             document.getElementById(slotDomId).innerHTML = '<h1>yourcustomInnerHTML</h1>';         }     } }); 

I try the above code, but even after the DOM has been loaded, it shows googletag as undefined.

i have integrated google adsense for my client's website, ads are showing in some devices, but in some devices it showing always, particularly ads are not showing always in my client's devices,

is that any mistake i did on my google adsense account to resolve this issue, or it is the nature of google adsense?

but client's want to get ads for all devices and every time it need to show on his website,

i have tried with lots of blogs about this, everything is failed, and i'm finally here, hopefully i get a valuable knowledge here,

this is my first question on stackoverflow, if i made any mistake on it, please don't mind it, i'll correct on my future questions.

Thanks in advance.