Title: DCO Insert Analytics Code
Author: Denis Yanchevskiy
Published: <strong>16 ມັງກອນ 2016</strong>
Last modified: 28 ກໍລະກົດ 2021

---

ຄົ້ນຫາປລັກອິນ

ປລັກອິນນີ້ **ຍັງບໍ່ທັນໄດ້ຮັບການທົດສອບກັບ WordPress 3 ເວີຊັນຫຼັກຫຼ້າສຸດ**. ມັນອາດຈະ
ບໍ່ໄດ້ຮັບການເບິ່ງແຍງ ຫຼື ສະໜັບສະໜູນອີກຕໍ່ໄປ ແລະ ອາດມີບັນຫາການເຮັດວຽກຮ່ວມກັນເມື່ອ
ໃຊ້ກັບ 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://lo.wordpress.org/plugins/dco-insert-analytics-code/#description)
 * [ການຣີວິວ](https://lo.wordpress.org/plugins/dco-insert-analytics-code/#reviews)
 *  [ການຕິດຕັ້ງ](https://lo.wordpress.org/plugins/dco-insert-analytics-code/#installation)
 * [ການພັດທະນາ](https://lo.wordpress.org/plugins/dco-insert-analytics-code/#developers)

 [ການຊ່ວຍເຫຼືອ](https://wordpress.org/support/plugin/dco-insert-analytics-code/)

## ຄຳອະທິບາຍ

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>

#### Usage

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)

#### ຕັ້ງ

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

## ພາບໜ້າຈໍ

 * [[
 * ຕັ້ງ page
 * [[
 * Example page

## ການຕິດຕັ້ງ

 1. Upload `dco-insert-analytics-code` folder to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## ຄຳຖາມທີ່ພົບເລື້ອຍ

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

## ການຣີວິວ

![](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 ເມສາ 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 ສິງຫາ 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 ພຶດສະພາ 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 ກຸມພາ 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 ພະຈິກ 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 ເມສາ 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” ແມ່ນຊອຟແວໂອເພັນຊອດ (Open Source). ບຸກຄົນຕໍ່ໄປນີ້ໄດ້ມີ
ສ່ວນຮ່ວມໃນການພັດທະນາປລັກອິນນີ້.

ຜູ້ຮ່ວມພັດທະນາ

 *   [ 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
 * 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)

 *  ເວີຊັນ **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://lo.wordpress.org/plugins/tags/analytics/)[google analytics](https://lo.wordpress.org/plugins/tags/google-analytics/)
   [metrika](https://lo.wordpress.org/plugins/tags/metrika/)[yandex metrica](https://lo.wordpress.org/plugins/tags/yandex-metrica/)
 *  [ມຸມມອງຂັ້ນສູງ](https://lo.wordpress.org/plugins/dco-insert-analytics-code/advanced/)

## ການໃຫ້ຄະແນນ

 5 ຈາກທັງໝົດ 5 ດາວ.

 *  [  ການວິຈານ 5 ດາວ ຈຳນວນ 8 ລາຍການ     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=5)
 *  [  ການວິຈານ 4 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=4)
 *  [  ການວິຈານ 3 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=3)
 *  [  ການວິຈານ 2 ດາວ ຈຳນວນ 0 ລາຍການ     ](https://wordpress.org/support/plugin/dco-insert-analytics-code/reviews/?filter=2)
 *  [  ການວິຈານ 1 ດາວ ຈຳນວນ 0 ລາຍການ     ](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/)