Title: DCO Insert Analytics Code
Author: Denis Yanchevskiy
Published: <strong>16.01.2016</strong>
Last modified: 28.07.2021

---

Поиск плагинов

Этот плагин **не тестировался с последними 3 основными выпусками WordPress**. Скорее
всего, он уже не поддерживается и может быть несовместим с текущими версиями WordPress.

![](https://ps.w.org/dco-insert-analytics-code/assets/icon.svg?rev=1806013)

# DCO Insert Analytics Code

 Автор: [Denis Yanchevskiy](https://profiles.wordpress.org/denisco/)

[Скачать](https://downloads.wordpress.org/plugin/dco-insert-analytics-code.1.1.3.zip)

 * [Детали](https://ru.wordpress.org/plugins/dco-insert-analytics-code/#description)
 * [Отзывы](https://ru.wordpress.org/plugins/dco-insert-analytics-code/#reviews)
 *  [Установка](https://ru.wordpress.org/plugins/dco-insert-analytics-code/#installation)
 * [Разработка](https://ru.wordpress.org/plugins/dco-insert-analytics-code/#developers)

 [Поддержка](https://wordpress.org/support/plugin/dco-insert-analytics-code/)

## Описание

DCO Insert Analytics Code это WordPress плагин предназначенный для вставки кода 
аналитики (или любого другого кода) перед </head> или после <body> или перед </body
>

#### Применение

After installation and activation, you can insert the necessary code to the respective
fields on the plugin settings page.
 [GitHub](https://github.com/yadenis/DCO-Insert-Analytics-Code)

#### Настройки

 * Перед </head>
 * После <body>
 * Перед </body>

#### Список фильтров

**dco_iac_get_options**

Фильтр для жесткого переопределения настроек плагина. При использовании этого фильтра,
вы не сможете редактировать их на странице настроек.

**dco_iac_insert_before_head**

Фильтр для изменения кода, вставленного перед </head>

**dco_iac_insert_before_head_show**

Фильтр для изменения отображения кода, вставленного перед </head>

**dco_iac_insert_after_body**

Фильтр для изменения кода, вставленного после <body>

**dco_iac_insert_after_body_show**

Фильтр для изменения отображения кода, вставленного после <body>

**dco_iac_insert_before_body**

Фильтр для изменения кода, вставленного перед </body>

**dco_iac_insert_before_body_show**

Фильтр для изменения отображения кода, вставленного перед <body>

**dco_iac_disable_do_shortcode**

Filter to disable shortcode processing in inserted codes

#### Примеры использования фильтров

**Жесткое переопределение настроек плагина**

    ```
    /*
    * $current - current plugin settings
    *
    * $options - plugin settings from database
    *
    * $default - default plugin settings
    */

    function custom_get_options($current, $options, $default) {
        $array = array(
            'before_head' => '<!-- before </head> -->',
            'before_head_show' => '0',
            'after_body' => '<!-- after <body> -->',
            'after_body_show' => '1',
            'before_body' => '<!-- before </body> -->',
            'before_body_show' => '2'
        );

        return $array;
    }

    add_filter('dco_iac_get_options', 'custom_get_options', 10, 3);
    ```

**Изменение кода перед </head>**

    ```
    /*
    * $code - value from "before </head>" setting
    */

    function custom_before_head_code( $code ) {
        return $code . '<!-- before <head> -->' . "\n";
    }

    add_filter( 'dco_iac_insert_before_head', 'custom_before_head_code' );
    ```

**Изменение отображения кода перед </body>**

    ```
    /*
    * $value - value from "before </body> show" setting
    */

    function custom_before_head_code( $value ) {
        return '2';
    }

    add_filter( 'dco_iac_insert_before_body_show', 'custom_before_body_show' );
    ```

**Disable shortcode processing in insert codes**

    ```
    add_filter('dco_iac_disable_do_shortcode', '__return_true');
    ```

## Скриншоты

 * [[
 * Страница настроек
 * [[
 * Пример страницы

## Установка

 1. Загрузите папку `dco-insert-analytics-code` в директорию `/wp-content/plugins/`
 2. Активируйте плагин используя меню ‘Плагины’ в WordPress

## Часто задаваемые вопросы

### Я вставил код на странице настроек плагина, но он не появился на сайте. В чем может быть причина?

 * Для корректной работы плагина, Ваша тема должна поддерживать [wp_head action hook](https://developer.wordpress.org/reference/functions/wp_head/)
   и [wp_footer action hook](https://developer.wordpress.org/reference/functions/wp_footer/).
 * Если Вы используете плагины для кеширования, Вам нужно очистить кеш для применения
   изменений.

## Отзывы

![](https://secure.gravatar.com/avatar/649fb2ded934d53d79b98a1f98c694d175ef9c644e28b89ea0eb8c3a64fdda39?
s=60&d=retro&r=g)

### 󠀁[Never edit theme files anymore](https://wordpress.org/support/topic/never-edit-theme-files-anymore/)󠁿

 [Yui](https://profiles.wordpress.org/fierevere/) 03.04.2021

Very light plugin that will make editing theme parts unnecessary. * header.php *
footer.php Safe! No possibility to break things, can be used by newbies. Suitable
for anything. * counters, analytics code * site verification with <meta> tags * 
adding loading additional scripts and styles or using them inline. * much more.

![](https://secure.gravatar.com/avatar/dbdd1319be33f8844aab507cccadd479800fdcc639419f3ddbad6951fdd96e3a?
s=60&d=retro&r=g)

### 󠀁[Мультисайт вп](https://wordpress.org/support/topic/%d0%bc%d1%83%d0%bb%d1%8c%d1%82%d0%b8%d1%81%d0%b0%d0%b9%d1%82-%d0%b2%d0%bf/)󠁿

 [igor420](https://profiles.wordpress.org/igor420/) 08.08.2019 1 ответ

Не хватает поддержки мультисайтовости. Очень просим

![](https://secure.gravatar.com/avatar/a8db7ea96a724a993d5ee8ec7edaf9a1f7c457426aeaf5e622d25bf604049e7d?
s=60&d=retro&r=g)

### 󠀁[Excellent Plugin](https://wordpress.org/support/topic/excellent-plugin-4871/)󠁿

 [blmbmj](https://profiles.wordpress.org/blmbmj/) 10.05.2019

Allows precise insertion of code at many template locations. Light, simply and works
well! Thank you.

![](https://secure.gravatar.com/avatar/1069b216c5de56588a7726ad6a487032e9b9d48fe9b1b831c73f1c7807f443f5?
s=60&d=retro&r=g)

### 󠀁[Great!](https://wordpress.org/support/topic/great-9279/)󠁿

 [bobbobbius](https://profiles.wordpress.org/bobbobbius/) 19.02.2019

i like it

![](https://secure.gravatar.com/avatar/35450a7872f68f28db0bb4e56895481d6b52bf259af1493c533b4de84c646b88?
s=60&d=retro&r=g)

### 󠀁[Simple & Functional](https://wordpress.org/support/topic/simple-functional-9/)󠁿

 [jc123](https://profiles.wordpress.org/jc123/) 24.11.2018

Thank you.

![](https://secure.gravatar.com/avatar/34134c14629645d633557bebd75676cdcceae803d71ade07f4e26c09501d08f7?
s=60&d=retro&r=g)

### 󠀁[Works with the plugin Elementor Page Builder](https://wordpress.org/support/topic/works-with-the-plugin-elementor-page-builder/)󠁿

 [Vad](https://profiles.wordpress.org/vadym1/) 13.04.2018

The code for analytics needed to be displayed on all pages including pages created
in Elementor Page Builder. This plugin helped solve this issue.

 [ Посмотреть все 8 отзывов ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/)

## Участники и разработчики

«DCO Insert Analytics Code» — проект с открытым исходным кодом. В развитие плагина
внесли свой вклад следующие участники:

Участники

 *   [ Denis Yanchevskiy ](https://profiles.wordpress.org/denisco/)

«DCO Insert Analytics Code» переведён на 2 языка. Благодарим [переводчиков](https://translate.wordpress.org/projects/wp-plugins/dco-insert-analytics-code/contributors)
за их работу.

[Перевести «DCO Insert Analytics Code» на ваш язык.](https://translate.wordpress.org/projects/wp-plugins/dco-insert-analytics-code)

### Заинтересованы в разработке?

[Посмотрите код](https://plugins.trac.wordpress.org/browser/dco-insert-analytics-code/),
проверьте [SVN репозиторий](https://plugins.svn.wordpress.org/dco-insert-analytics-code/),
или подпишитесь на [журнал разработки](https://plugins.trac.wordpress.org/log/dco-insert-analytics-code/)
по [RSS](https://plugins.trac.wordpress.org/log/dco-insert-analytics-code/?limit=100&mode=stop_on_copy&format=rss).

## Журнал изменений

#### 1.1.3

 * Add settings link to Plugins page
 * Скорректировано описание плагина

#### 1.1.2

 * Constant `DCO_IAC_DO_SHORTCODE` replaced with `dco_iac_disable_do_shortcode` 
   filter. Use `add_filter('dco_iac_disable_do_shortcode', '__return_true');` to
   disable shortcodes support.

#### 1.1.1

 * Added feature to hide the code
 * Added shortcodes support (add constant `define('DCO_IAC_DO_SHORTCODE', false);`
   to wp-config.php for disable)

#### 1.1.0

 * Исправлен идентификатор перевода
 * Добавлена возможность регулировать отображение кода для вошедших / невошедших
   пользователей
 * Ограничен прямой доступ к файлам плагина

#### 1.0.0

 * Первый релиз

## Мета

 *  Версия **1.1.3**
 *  Обновление: **5 лет назад**
 *  Активных установок: **4 000+**
 *  Версия WordPress ** 4.6 или выше **
 *  Совместим вплоть до: **5.8.13**
 *  Версия PHP ** 5.3 или выше **
 *  Языки
 * [English (US)](https://wordpress.org/plugins/dco-insert-analytics-code/), [Russian](https://ru.wordpress.org/plugins/dco-insert-analytics-code/)
   и [Swedish](https://sv.wordpress.org/plugins/dco-insert-analytics-code/).
 *  [Перевести на ваш язык](https://translate.wordpress.org/projects/wp-plugins/dco-insert-analytics-code)
 * Метки:
 * [analytics](https://ru.wordpress.org/plugins/tags/analytics/)[google analytics](https://ru.wordpress.org/plugins/tags/google-analytics/)
   [metrika](https://ru.wordpress.org/plugins/tags/metrika/)[yandex metrica](https://ru.wordpress.org/plugins/tags/yandex-metrica/)
 *  [Дополнительно](https://ru.wordpress.org/plugins/dco-insert-analytics-code/advanced/)

## Оценки

 5 из 5 звёзд.

 *  [  8 5-звездный отзыв     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=5)
 *  [  0 4-звездный отзыв     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=4)
 *  [  0 3-звездный отзыв     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=3)
 *  [  0 2-звездный отзыв     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=2)
 *  [  0 1-звездный отзыв     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/#new-post)

[Посмотреть всеотзывы](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/)

## Участники

 *   [ Denis Yanchevskiy ](https://profiles.wordpress.org/denisco/)

## Поддержка

Есть что сказать? Нужна помощь?

 [Перейти в форум поддержки](https://wordpress.org/support/plugin/dco-insert-analytics-code/)