Google Analytics (gtag)
This commit is contained in:
parent
8767d71972
commit
213a7ca783
@ -32,6 +32,19 @@ const WrappedApp = (props) =>
|
||||
<>
|
||||
{ !props.observer && (
|
||||
<>
|
||||
<Script
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${ process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID }`}
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
<Script id="google-analytics" strategy="afterInteractive">
|
||||
{`
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){window.dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '${ process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID }');
|
||||
`}
|
||||
</Script>
|
||||
<Script id="yandex-metrica" strategy={'afterInteractive'}>
|
||||
{`
|
||||
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user