Install Software For Free

DCO Insert Analytics Code

Developer denisco
Update Time July 28, 2021, 8:29 p.m.
PHP Version: 5.3 +
WordPress Version: 5.8
Copyright: GPLv2 or later
Copyright URL: Copyright Information

Tag

analytics google analytics metrika yandex metrica

Download

1.0.0 1.1.0 1.1.1 1.1.2 1.1.3

Description:

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> 用法 After installation and activation, you can insert the necessary code to the respective fields on the plugin settings page. GitHub 設定 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_show' => '0', 'after_body' => '', 'after_body_show' => '1', '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 " setting / function custom_before_head_code( $code ) { return $code . '' . "\n"; } add_filter( 'dco_iac_insert_before_head', 'custom_before_head_code' ); Change before </body> code show / * $value - value from "before 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');

Installation:

  1. Upload dco-insert-analytics-code folder to the /wp-content/plugins/ directory
  2. 通过WordPress的的“Plugins”菜单激活插件

Screenshots:

  • Settings page
  • Example page

FAQs:

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

Changelog:

1.1.3 1.1.2 1.1.1 1.1.0 1.0.0