Reputation: 51
I inserted Google's GDPR messaging in my site. Unfortunately, it ads a div with class="google-revocation-link-placeholder" that is supposed to go in the footer but gets placed apparently randomly in the page. I could not find any info on this class in Google Adsense documentation and only one reference in a google search, with no answers. Is there a way to move it to a predefined position?
I tried with jquery once the page gets loaded, but unfortunately the function is triggered too early in the rendition process so has no effect.
example of wrong placement of the div
Upvotes: 5
Views: 1518
Reputation: 1
javascript:googlefc.callbackQueue.push(googlefc.showRevocationMessage)
A revocation link from google support doesn't work.
Upvotes: -1
Reputation: 70
You can use a mutation observer to remove the element from the DOM.
const observer = new MutationObserver(() => {
document.querySelector(".google-revocation-link-placeholder")?.remove();
});
observer.observe(document.body, {
childList: true,
});
You should probably add a revocation link to the page to remain compliant though.
Upvotes: 2