Remove metrika id from env
This commit is contained in:
@@ -41,9 +41,6 @@ steps:
|
||||
from_secret: ssh_private_key
|
||||
MONGODB_URI:
|
||||
from_secret: MONGODB_URI
|
||||
YA_METRIKA_ID:
|
||||
from_secret: YA_METRIKA_ID
|
||||
NODE_ENV: production
|
||||
commands:
|
||||
- git clone -b monorepo https://git.radner.ru/anatolykopyl/warframe-center.git
|
||||
- cd warframe-center
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
MONGODB_URI=
|
||||
YA_METRIKA_ID=
|
||||
|
||||
@@ -2,20 +2,18 @@ import Router from 'next/router'
|
||||
import React, { useCallback, useEffect } from 'react'
|
||||
import ym, { YMInitializer } from 'react-yandex-metrika'
|
||||
|
||||
const enabled =
|
||||
process.env.NODE_ENV === 'production' &&
|
||||
process.env.YA_METRIKA_ID
|
||||
|
||||
const WithYandexMetrika = (props) => {
|
||||
const { children } = props
|
||||
|
||||
const enabled = process.env.NODE_ENV !== 'development'
|
||||
|
||||
const hit = useCallback((url) => {
|
||||
if (enabled) {
|
||||
ym('hit', url)
|
||||
} else {
|
||||
console.log('%c[YandexMetrika](HIT)', 'color: orange', url)
|
||||
}
|
||||
}, [])
|
||||
}, [enabled])
|
||||
|
||||
useEffect(() => {
|
||||
hit(window.location.pathname + window.location.search)
|
||||
@@ -26,7 +24,7 @@ const WithYandexMetrika = (props) => {
|
||||
<>
|
||||
{enabled && (
|
||||
<YMInitializer
|
||||
accounts={[Number(process.env.YA_METRIKA_ID)]}
|
||||
accounts={[87671663]}
|
||||
options={{ webvisor: true, defer: true }}
|
||||
version='2'
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user