-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yandex Metrica counter snippet #4895
base: main
Are you sure you want to change the base?
Conversation
Azlydnev yandex metrica
Codecov Report
@@ Coverage Diff @@
## main #4895 +/- ##
============================================
- Coverage 32.08% 32.07% -0.02%
- Complexity 11386 11395 +9
============================================
Files 1170 1171 +1
Lines 47954 47974 +20
============================================
Hits 15388 15388
- Misses 32566 32586 +20
|
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) | ||
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); | ||
|
||
ym(<?= json_encode((int) ($YANDEX_METRICA_ID ?? ''), JSON_THROW_ON_ERROR) ?> , "init", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are casting this value to an int
, then we do not need json_encode()
?
Also, $YANDEX_METRICA_ID
can never be null
. So we do not need ?? ''
|
||
<div class="row mb-3"> | ||
<label for="YANDEX_METRICA_ID" class="col-sm-3 col-form-label"> | ||
<?= /* I18N: A configuration setting */ I18N::translate('Yandex Metica') ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Metica -> Metrica
Add support for Yandex Merica counter.
Used standard snippet
https://metrika.yandex.ru/