soranoo / next-google-adsense

Add Google AdSense to your Next.js app.
MIT License
13 stars 2 forks source link

Unit Ads No Show #6

Open MicroMatrixOrg opened 1 month ago

MicroMatrixOrg commented 1 month ago

My nextjs version is 14.2.3 and react version is ^18.3.1. My AD is not show. There is my infomation

AdSense head tag doesn't support data-nscript attribute. (匿名) @ adsbygoogle.js?client=ca-pub-xxxx:220 Fd @ adsbygoogle.js?client=ca-pub-xx:44 Zp @ adsbygoogle.js?client=ca-pub-xx:220 $p @ adsbygoogle.js?client=ca-pub-xx:221 (匿名) @ adsbygoogle.js?client=ca-pub-xx:235 ha @ adsbygoogle.js?client=ca-pub-xx:56 Cj @ adsbygoogle.js?client=ca-pub-xx:94 (匿名) @ adsbygoogle.js?client=ca-pub-xx:234 (匿名) @ adsbygoogle.js?client=ca-pub-xx:236 (匿名) @ adsbygoogle.js?client=ca-pub-xx:238

soranoo commented 1 month ago

Can I have a screenshot of the browser console?

Please make sure to turn off ALL AD blocks before taking the screenshot.

MicroMatrixOrg commented 1 month ago

Can I have a screenshot of the browser console?

Please make sure to turn off ALL AD blocks before taking the screenshot.

Can I have a screenshot of the browser console?

Please make sure to turn off ALL AD blocks before taking the screenshot.

I have disabled all AD blockers and opened my website in incognito mode. Due to previous prompts, I modified the code as follows:


import Head from "next/head";

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" suppressHydrationWarning>
      <Head>
        <GoogleAdSense />
        <link rel="icon" href="/images/favicon.ico" />
      </Head>
      <body className={inter.className}>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}

Although the warning prompt is gone, the ads are not displaying. The ins tag has no content.

soranoo commented 1 month ago

Which ad unit(s) are you using?

MicroMatrixOrg commented 1 month ago

Which ad unit(s) are you using?

  <AdUnit
    publisherId="pub-xxxx"
    slotId="101xxx"
    layout="display"
  />

Display Ads

soranoo commented 1 month ago

Everything seems correct. You may send an email to Google to ask for help.

ref: https://support.google.com/adsense/thread/12694955/ads-not-showing-on-my-website

MicroMatrixOrg commented 1 month ago

Everything seems correct. You may send an email to Google to ask for help.

ref: https://support.google.com/adsense/thread/12694955/ads-not-showing-on-my-website

I have another site, under this main domain. They can display ads normally

MicroMatrixOrg commented 1 month ago

Everything seems correct. You may send an email to Google to ask for help.

ref: https://support.google.com/adsense/thread/12694955/ads-not-showing-on-my-website

And the automated ads work, except that the unit ads don't appear

soranoo commented 1 month ago

Lets put the ins element directly into the code

    <ins
      className="adsbygoogle"
      style={{ display: "block" }}
      data-ad-format="auto"
      data-full-width-responsive="true"
      data-ad-client="ca-pub-XXXXXXXXXXXXXX"
      data-ad-slot="YYYYYYYYYYYY"
    />
MicroMatrixOrg commented 1 month ago

Lets put the ins element directly into the code

    <ins
      className="adsbygoogle"
      style={{ display: "block" }}
      data-ad-format="auto"
      data-full-width-responsive="true"
      data-ad-client="ca-pub-XXXXXXXXXXXXXX"
      data-ad-slot="YYYYYYYYYYYY"
    />

It is very strange. It work on another site image There is my not work site. image I give up it.LooooooooL. Thanks your help.If I solve the problem. I will update the form.