Christian Deligant
Christian Deligant

Reputation: 51

how to restyle or move google-revocation-link-placeholder

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

Answers (2)

serguei
serguei

Reputation: 1

javascript:googlefc.callbackQueue.push(googlefc.showRevocationMessage)

A revocation link from google support doesn't work.

Upvotes: -1

endaquigley
endaquigley

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

Related Questions