Title: DCO Insert Analytics Code
Author: Denis Yanchevskiy
Published: <strong>16 janeiro, 2016</strong>
Last modified: 28 julho, 2021

---

Pesquisar plugins

Este plugin **não foi testado com os 3 lançamentos principais mais recentes do WordPress**.
Ele pode não ser mais mantido ou suportado e pode ter problemas de compatibilidade
quando usado com versões mais recentes do WordPress.

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

# DCO Insert Analytics Code

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

[Baixar](https://downloads.wordpress.org/plugin/dco-insert-analytics-code.1.1.3.zip)

 * [Detalhes](https://br.wordpress.org/plugins/dco-insert-analytics-code/#description)
 * [Avaliações](https://br.wordpress.org/plugins/dco-insert-analytics-code/#reviews)
 *  [Instalação](https://br.wordpress.org/plugins/dco-insert-analytics-code/#installation)
 * [Desenvolvimento](https://br.wordpress.org/plugins/dco-insert-analytics-code/#developers)

 [Suporte](https://wordpress.org/support/plugin/dco-insert-analytics-code/)

## Descrição

DCO Insert Analytics Code is a WordPress plugin is intended for insert analytics
code(or any custom code) before </head> or after <body> or before </body>

#### Uso

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)

#### Configurações

 * Before </head> code
 * After <body> code
 * Before </body> code

#### Filters list

**dco_iac_get_options**

Filter for hardcoding override plugin settings. You won’t be able to edit them on
the settings page anymore when using this filter.

**dco_iac_insert_before_head**

Filter to change the code is inserted before </head>

**dco_iac_insert_before_head_show**

Filter to change show the code is inserted before </head>

**dco_iac_insert_after_body**

Filter to change the code is inserted after <body>

**dco_iac_insert_after_body_show**

Filter to change show the code is inserted after <body>

**dco_iac_insert_before_body**

Filter to change the code is inserted before </body>

**dco_iac_insert_before_body_show**

Filter to change show the code is inserted before </body>

**dco_iac_disable_do_shortcode**

Filter to disable shortcode processing in inserted codes

#### Examples of using filters

**Hardcoding override plugin settings**

    ```
    /*
    * $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);
    ```

**Change before </head> code**

    ```
    /*
    * $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' );
    ```

**Change before </body> code show**

    ```
    /*
    * $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');
    ```

## Capturas de tela

 * [[
 * Página de configurações
 * [[
 * Example page

## Instalação

 1. Upload `dco-insert-analytics-code` folder to the `/wp-content/plugins/` directory
 2. Ative o plugin por meio do menu “Plugins” no WordPress

## Perguntas frequentes

### I put the code on the plugin settings page, but it does not appear on the site. What could be the reason?

 * For correct work plugin your theme must support [wp_head action hook](https://developer.wordpress.org/reference/functions/wp_head/)
   and [wp_footer action hook](https://developer.wordpress.org/reference/functions/wp_footer/).
 * If you are using plugins for caching you need to clear the cache to apply the
   changes.

## Avaliações

![](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/) 3 abril, 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/) 8 agosto, 2019 1 resposta

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

![](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 maio, 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 fevereiro, 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 novembro, 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 abril, 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.

 [ Leia todas as 8 avaliações ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/)

## Colaboradores e desenvolvedores

“DCO Insert Analytics Code” é um programa de código aberto. As seguintes pessoas
contribuíram para este plugin.

Colaboradores

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

DCO Insert Analytics Code” foi traduzido para 2 localidades. Agradecemos aos [tradutores](https://translate.wordpress.org/projects/wp-plugins/dco-insert-analytics-code/contributors)
por suas contribuições.

[Traduzir o “DCO Insert Analytics Code” para seu idioma.](https://translate.wordpress.org/projects/wp-plugins/dco-insert-analytics-code)

### Interessado no desenvolvimento?

[Navegue pelo código](https://plugins.trac.wordpress.org/browser/dco-insert-analytics-code/),
consulte o [repositório SVN](https://plugins.svn.wordpress.org/dco-insert-analytics-code/)
ou assine o [registro de desenvolvimento](https://plugins.trac.wordpress.org/log/dco-insert-analytics-code/)
por [RSS](https://plugins.trac.wordpress.org/log/dco-insert-analytics-code/?limit=100&mode=stop_on_copy&format=rss).

## Registro de alterações

#### 1.1.3

 * Add settings link to Plugins page
 * Correct plugin description

#### 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

 * Fixed Text Domain
 * Added the ability to adjust the show code for logged / not logged users
 * Restricted direct access to plugin files

#### 1.0.0

 * Initial Release

## Meta

 *  Versão **1.1.3**
 *  Última atualização **5 anos atrás**
 *  Instalações ativas **4.000+**
 *  Versão do WordPress ** 4.6 ou superior **
 *  Testado até **5.8.13**
 *  Versão do PHP ** 5.3 ou superior **
 *  Idiomas
 * [English (US)](https://wordpress.org/plugins/dco-insert-analytics-code/), [Russian](https://ru.wordpress.org/plugins/dco-insert-analytics-code/)
   e [Swedish](https://sv.wordpress.org/plugins/dco-insert-analytics-code/).
 *  [Traduzir para seu idioma](https://translate.wordpress.org/projects/wp-plugins/dco-insert-analytics-code)
 * Tags
 * [analytics](https://br.wordpress.org/plugins/tags/analytics/)[google analytics](https://br.wordpress.org/plugins/tags/google-analytics/)
   [metrika](https://br.wordpress.org/plugins/tags/metrika/)[yandex metrica](https://br.wordpress.org/plugins/tags/yandex-metrica/)
 *  [Visualização avançada](https://br.wordpress.org/plugins/dco-insert-analytics-code/advanced/)

## Classificações

 5 de 5 estrelas.

 *  [  8 avaliações com 5 estrelas     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=5)
 *  [  0 avaliação com 4 estrela     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=4)
 *  [  0 avaliação com 3 estrela     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=3)
 *  [  0 avaliação com 2 estrela     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=2)
 *  [  0 avaliação com 1 estrela     ](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)

[Ver todas avaliações](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/)

## Colaboradores

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

## Suporte

Tem algo a dizer? Precisa de ajuda?

 [Ver fórum de suporte](https://wordpress.org/support/plugin/dco-insert-analytics-code/)