mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
fix: ad script
This commit is contained in:
parent
207d6ec785
commit
12ea06b57d
@ -1,10 +1,5 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
const Advertisement = (): JSX.Element => {
|
||||
useEffect(() => {
|
||||
if(process.env.NODE_ENV === 'production') window.adsbygoogle.push({})
|
||||
})
|
||||
|
||||
|
||||
return <div className={`z-0 mx-auto w-full text-center text-white ${process.env.NODE_ENV === 'production' ? '' : 'py-12 bg-gray-700'}`} style={{ height: '90px' }}>
|
||||
{
|
||||
process.env.NODE_ENV === 'production' ? <ins
|
||||
@ -18,11 +13,4 @@ const Advertisement = (): JSX.Element => {
|
||||
}</div>
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window { adsbygoogle: {
|
||||
loaded: boolean
|
||||
push(obj: unknown): void
|
||||
} }
|
||||
}
|
||||
|
||||
export default Advertisement
|
||||
|
||||
@ -22,6 +22,7 @@ class MyDocument extends Document {
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
(adsbygoogle = window.adsbygoogle || []).push({})
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user