Version Description
[ Add Function ][ Google Analytics ] Be able to set Both UA and GA4 tag.
Download this release
Release Info
Developer | kurudrive |
Plugin | VK All in One Expansion Unit |
Version | 9.82.0.0 |
Comparing to | |
See all releases |
Code changes from version 9.81.3.0 to 9.82.0.0
- inc/google_analytics/ga_admin.php +25 -36
- inc/google_analytics/ga_customizer.php +35 -34
- inc/google_analytics/google_analytics.php +67 -85
- readme.txt +4 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +4 -4
- vendor/composer/installed.php +6 -6
- vkExUnit.php +1 -1
inc/google_analytics/ga_admin.php
CHANGED
@@ -1,43 +1,32 @@
|
|
1 |
<?php
|
2 |
$options = vkExUnit_get_ga_options();
|
3 |
// $options_default = veu_get_sns_options_default();
|
4 |
-
|
5 |
-
|
6 |
/*-------------------------------------------*/
|
7 |
?>
|
8 |
<div id="seoSetting" class="sectionBox">
|
9 |
-
<h3><?php _e( 'Google Analytics Settings', 'vk-all-in-one-expansion-unit' ); ?></h3>
|
10 |
-
<table class="form-table">
|
11 |
-
<!-- Google Analytics -->
|
12 |
-
<tr>
|
13 |
-
<th><?php _e( 'Google Analytics Settings', 'vk-all-in-one-expansion-unit' ); ?></th>
|
14 |
-
<td
|
15 |
-
<p
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
$
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
<?php }
|
33 |
-
}
|
34 |
-
?>
|
35 |
-
</dd>
|
36 |
-
</dl>
|
37 |
-
<label>
|
38 |
-
<input type="checkbox" name="vkExUnit_ga_options[disableLoggedin]" id="disableLoggedin" value="true" <?php echo ( $options['disableLoggedin'] ) ? 'checked' : ''; ?> /><?php _e( 'Disable tracking of logged in user', 'vk-all-in-one-expansion-unit' ); ?></label>
|
39 |
-
</td>
|
40 |
-
</tr>
|
41 |
-
</table>
|
42 |
-
<?php submit_button(); ?>
|
43 |
</div>
|
1 |
<?php
|
2 |
$options = vkExUnit_get_ga_options();
|
3 |
// $options_default = veu_get_sns_options_default();
|
4 |
+
/*
|
5 |
+
Google Analytics
|
6 |
/*-------------------------------------------*/
|
7 |
?>
|
8 |
<div id="seoSetting" class="sectionBox">
|
9 |
+
<h3><?php _e( 'Google Analytics Settings', 'vk-all-in-one-expansion-unit' ); ?></h3>
|
10 |
+
<table class="form-table">
|
11 |
+
<!-- Google Analytics -->
|
12 |
+
<tr>
|
13 |
+
<th><?php _e( 'Google Analytics Settings', 'vk-all-in-one-expansion-unit' ); ?></th>
|
14 |
+
<td>
|
15 |
+
<p><?php _e( 'Please fill in the Google Analytics ID from the Analytics embed code used in the site.', 'vk-all-in-one-expansion-unit' ); ?></p>
|
16 |
+
<label for="gaId-GA4"><?php _e( 'GA4', 'vk-all-in-one-expansion-unit' ); ?></label><br />
|
17 |
+
<input type="text" name="vkExUnit_ga_options[gaId-GA4]" id="gaId-GA4" value="<?php echo esc_attr( $options['gaId-GA4'] ); ?>" style="width:90%;" /><br />
|
18 |
+
<?php _e( 'ex) ', 'vk-all-in-one-expansion-unit' ); ?>G-XXXXXXXXXX<br />
|
19 |
+
<?php _e( 'Stream ID and measurement ID are different.', 'vk-all-in-one-expansion-unit' ); ?><?php _e( 'You can check the measurement ID by selecting the stream name you want to measure from "Management" -> "Data stream" of the gear icon at the bottom left of the Google Analytics screen.', 'vk-all-in-one-expansion-unit' ); ?><br />
|
20 |
+
<br />
|
21 |
+
<label for="gaId-UA"><?php _e( 'Universal Analytics', 'vk-all-in-one-expansion-unit' ); ?></label><br />
|
22 |
+
<input type="text" name="vkExUnit_ga_options[gaId-UA]" id="gaId-UA" value="<?php echo esc_attr( $options['gaId-UA'] ); ?>" style="width:90%;" /><br />
|
23 |
+
<?php _e( 'ex) ', 'vk-all-in-one-expansion-unit' ); ?>UA-XXXXXXXX-XX<br />
|
24 |
+
<br />
|
25 |
+
<label>
|
26 |
+
<input type="checkbox" name="vkExUnit_ga_options[disableLoggedin]" id="disableLoggedin" value="true" <?php echo ( $options['disableLoggedin'] ) ? 'checked' : ''; ?> /><?php _e( 'Disable tracking of logged in user', 'vk-all-in-one-expansion-unit' ); ?>
|
27 |
+
</label>
|
28 |
+
</td>
|
29 |
+
</tr>
|
30 |
+
</table>
|
31 |
+
<?php submit_button(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
</div>
|
inc/google_analytics/ga_customizer.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
/*-------------------------------------------*/
|
6 |
add_filter( 'veu_customize_panel_activation', 'veu_customize_panel_activation_ga' );
|
7 |
function veu_customize_panel_activation_ga() {
|
@@ -14,10 +14,10 @@ if ( apply_filters( 'veu_customize_panel_activation', false ) ) {
|
|
14 |
|
15 |
function veu_customize_register_ga( $wp_customize ) {
|
16 |
|
17 |
-
|
18 |
-
|
19 |
/*-------------------------------------------*/
|
20 |
-
//1. テーマカスタマイザー上に新しいセクションを追加
|
21 |
$wp_customize->add_section(
|
22 |
'veu_ga_setting',
|
23 |
array(
|
@@ -27,10 +27,10 @@ function veu_customize_register_ga( $wp_customize ) {
|
|
27 |
)
|
28 |
);
|
29 |
|
30 |
-
//2. WPデータベースに新しいテーマ設定を追加
|
31 |
-
// Google Analytics ID
|
32 |
$wp_customize->add_setting(
|
33 |
-
'vkExUnit_ga_options[gaId]',
|
34 |
array(
|
35 |
'default' => '',
|
36 |
'type' => 'option', // 保存先 option or theme_mod
|
@@ -41,41 +41,42 @@ function veu_customize_register_ga( $wp_customize ) {
|
|
41 |
|
42 |
$wp_customize->add_control(
|
43 |
new ExUnit_Custom_Text_Control(
|
44 |
-
$wp_customize,
|
45 |
-
|
|
|
|
|
46 |
'section' => 'veu_ga_setting',
|
47 |
-
'settings' => 'vkExUnit_ga_options[gaId]',
|
48 |
'type' => 'text',
|
49 |
-
'description' => __( 'Please fill in the Google Analytics ID from the Analytics embed code used in the site.<br>ex)
|
50 |
'input_before' => 'UA-',
|
51 |
)
|
52 |
)
|
53 |
);
|
54 |
|
55 |
-
//
|
56 |
$wp_customize->add_setting(
|
57 |
-
'vkExUnit_ga_options[
|
58 |
array(
|
59 |
-
'default' => '
|
60 |
-
'type' => 'option',
|
61 |
'capability' => 'edit_theme_options',
|
62 |
-
'sanitize_callback' => '
|
63 |
)
|
64 |
);
|
|
|
65 |
$wp_customize->add_control(
|
66 |
-
|
67 |
-
|
68 |
-
'
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
'
|
75 |
-
'
|
76 |
-
|
77 |
-
),
|
78 |
-
'description' => __( 'Print the select the type of Analytics code.<br>(If you are unsure you can skip this.)', 'vk-all-in-one-expansion-unit' ),
|
79 |
)
|
80 |
);
|
81 |
|
@@ -93,10 +94,10 @@ function veu_customize_register_ga( $wp_customize ) {
|
|
93 |
$wp_customize->add_control(
|
94 |
'enableOGTags',
|
95 |
array(
|
96 |
-
'label'
|
97 |
-
'section'
|
98 |
-
'settings'
|
99 |
-
'type'
|
100 |
)
|
101 |
);
|
102 |
|
1 |
<?php
|
2 |
|
3 |
+
/*
|
4 |
+
Add Customize Panel
|
5 |
/*-------------------------------------------*/
|
6 |
add_filter( 'veu_customize_panel_activation', 'veu_customize_panel_activation_ga' );
|
7 |
function veu_customize_panel_activation_ga() {
|
14 |
|
15 |
function veu_customize_register_ga( $wp_customize ) {
|
16 |
|
17 |
+
/*
|
18 |
+
ga Settings セクション、テーマ設定、コントロールを追加
|
19 |
/*-------------------------------------------*/
|
20 |
+
// 1. テーマカスタマイザー上に新しいセクションを追加
|
21 |
$wp_customize->add_section(
|
22 |
'veu_ga_setting',
|
23 |
array(
|
27 |
)
|
28 |
);
|
29 |
|
30 |
+
// 2. WPデータベースに新しいテーマ設定を追加
|
31 |
+
// Google Analytics ID (GA4)
|
32 |
$wp_customize->add_setting(
|
33 |
+
'vkExUnit_ga_options[gaId-GA4]',
|
34 |
array(
|
35 |
'default' => '',
|
36 |
'type' => 'option', // 保存先 option or theme_mod
|
41 |
|
42 |
$wp_customize->add_control(
|
43 |
new ExUnit_Custom_Text_Control(
|
44 |
+
$wp_customize,
|
45 |
+
'gaId-GA4',
|
46 |
+
array(
|
47 |
+
'label' => __( 'Google Analytics ID ( GA4 )', 'vk-all-in-one-expansion-unit' ),
|
48 |
'section' => 'veu_ga_setting',
|
49 |
+
'settings' => 'vkExUnit_ga_options[gaId-GA4]',
|
50 |
'type' => 'text',
|
51 |
+
'description' => __( 'Please fill in the Google Analytics ID ( GA4 ) from the Analytics embed code used in the site.<br>ex) G-XXXXXXXXXX', 'vk-all-in-one-expansion-unit' ),
|
52 |
'input_before' => 'UA-',
|
53 |
)
|
54 |
)
|
55 |
);
|
56 |
|
57 |
+
// Google Analytics ID (UA)
|
58 |
$wp_customize->add_setting(
|
59 |
+
'vkExUnit_ga_options[gaId-UA]',
|
60 |
array(
|
61 |
+
'default' => '',
|
62 |
+
'type' => 'option', // 保存先 option or theme_mod
|
63 |
'capability' => 'edit_theme_options',
|
64 |
+
'sanitize_callback' => 'sanitize_text_field',
|
65 |
)
|
66 |
);
|
67 |
+
|
68 |
$wp_customize->add_control(
|
69 |
+
new ExUnit_Custom_Text_Control(
|
70 |
+
$wp_customize,
|
71 |
+
'gaId-UA',
|
72 |
+
array(
|
73 |
+
'label' => __( 'Google Analytics ID ( UA )', 'vk-all-in-one-expansion-unit' ),
|
74 |
+
'section' => 'veu_ga_setting',
|
75 |
+
'settings' => 'vkExUnit_ga_options[gaId-UA]',
|
76 |
+
'type' => 'text',
|
77 |
+
'description' => __( 'Please fill in the Google Analytics ID ( UA ) from the Analytics embed code used in the site.<br>ex) UA-XXXXXXXX-XX', 'vk-all-in-one-expansion-unit' ),
|
78 |
+
'input_before' => 'UA-',
|
79 |
+
)
|
|
|
|
|
80 |
)
|
81 |
);
|
82 |
|
94 |
$wp_customize->add_control(
|
95 |
'enableOGTags',
|
96 |
array(
|
97 |
+
'label' => __( 'Disable tracking of logged in user', 'vk-all-in-one-expansion-unit' ),
|
98 |
+
'section' => 'veu_ga_setting',
|
99 |
+
'settings' => 'vkExUnit_ga_options[disableLoggedin]',
|
100 |
+
'type' => 'checkbox',
|
101 |
)
|
102 |
);
|
103 |
|
inc/google_analytics/google_analytics.php
CHANGED
@@ -1,18 +1,17 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
/*-------------------------------------------*/
|
5 |
|
6 |
function vkExUnit_add_ga_options_page() {
|
7 |
// require dirname( __FILE__ ) . '/ga_admin.php';
|
8 |
-
require_once
|
9 |
}
|
10 |
// カスタマイザー読み込み
|
11 |
-
require_once
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
|
16 |
/*-------------------------------------------*/
|
17 |
function vkExUnit_ga_options_init() {
|
18 |
if ( false === vkExUnit_get_ga_options() ) {
|
@@ -20,7 +19,7 @@ function vkExUnit_ga_options_init() {
|
|
20 |
}
|
21 |
|
22 |
vkExUnit_register_setting(
|
23 |
-
__( 'Google Analytics Settings', 'vk-all-in-one-expansion-unit' ), //
|
24 |
'vkExUnit_ga_options', // name attr
|
25 |
'vkExUnit_ga_options_validate',
|
26 |
'vkExUnit_add_ga_options_page'
|
@@ -31,6 +30,21 @@ add_action( 'veu_package_init', 'vkExUnit_ga_options_init' );
|
|
31 |
function vkExUnit_get_ga_options() {
|
32 |
$options = get_option( 'vkExUnit_ga_options', vkExUnit_get_ga_options_default() );
|
33 |
$options_dafault = vkExUnit_get_ga_options_default();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
foreach ( $options_dafault as $key => $value ) {
|
35 |
$options[ $key ] = ( isset( $options[ $key ] ) ) ? $options[ $key ] : $options_dafault[ $key ];
|
36 |
}
|
@@ -39,15 +53,16 @@ function vkExUnit_get_ga_options() {
|
|
39 |
|
40 |
function vkExUnit_get_ga_options_default() {
|
41 |
$default_options = array(
|
42 |
-
'gaId'
|
43 |
-
'
|
44 |
-
'disableLoggedin'
|
45 |
);
|
|
|
46 |
return apply_filters( 'vkExUnit_ga_options_default', $default_options );
|
47 |
}
|
48 |
|
49 |
-
|
50 |
-
|
51 |
/*-------------------------------------------*/
|
52 |
function vkExUnit_ga_options_validate( $input ) {
|
53 |
// デフォルト値を取得
|
@@ -56,85 +71,52 @@ function vkExUnit_ga_options_validate( $input ) {
|
|
56 |
$input = wp_parse_args( $input, $defaults );
|
57 |
|
58 |
// 入力値をサニタイズ
|
59 |
-
$output['gaId']
|
60 |
-
$output['
|
61 |
-
$output['disableLoggedin'] = ($input['disableLoggedin'] ) ? true : false;
|
62 |
|
63 |
return apply_filters( 'vkExUnit_ga_options_validate', $output, $input, $defaults );
|
64 |
}
|
65 |
|
|
|
|
|
66 |
/*-------------------------------------------*/
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
$
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
$
|
77 |
-
|
78 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
}
|
80 |
-
add_action( 'wp_head', 'vkExUnit_googleAnalytics', $priority );
|
81 |
}
|
82 |
|
83 |
-
function
|
84 |
-
|
85 |
-
$gaId = esc_html( $options['gaId'] );
|
86 |
-
$gaType = esc_html( $options['gaType'] );
|
87 |
-
$disableLoggedin = ($options['disableLoggedin'] ) ? true : false;
|
88 |
-
if ( $gaId && !( $disableLoggedin && is_user_logged_in())) {
|
89 |
-
|
90 |
-
if ( $gaType == 'gaType_universal' ) {
|
91 |
-
$domainUrl = home_url();
|
92 |
-
$delete = array( 'http://', 'https://' );
|
93 |
-
$domain = str_replace( $delete, '', $domainUrl ); ?>
|
94 |
-
<script>
|
95 |
-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
96 |
-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
97 |
-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
98 |
-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
99 |
-
|
100 |
-
ga('create', 'UA-<?php echo esc_attr( $gaId ); ?>', '<?php echo $domain; ?>');
|
101 |
-
ga('send', 'pageview');
|
102 |
-
</script>
|
103 |
-
<?php
|
104 |
-
|
105 |
-
} elseif ( $gaType == 'gaType_normal' ) {
|
106 |
-
?>
|
107 |
-
<script type="text/javascript">
|
108 |
-
|
109 |
-
var _gaq = _gaq || [];
|
110 |
-
_gaq.push(['_setAccount', 'UA-<?php echo $gaId; ?>']);
|
111 |
-
_gaq.push(['_trackPageview']);
|
112 |
-
|
113 |
-
(function() {
|
114 |
-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
115 |
-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
116 |
-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
117 |
-
})();
|
118 |
-
|
119 |
-
</script>
|
120 |
-
<?php
|
121 |
-
} else {
|
122 |
-
// $gaType == 'gaType_gtag'
|
123 |
-
if ( ! preg_match( '/G-/', $gaId ) && ! preg_match( '/UA-/', $gaId ) ){
|
124 |
-
$gtag_id = 'UA-' . $gaId;
|
125 |
-
} else {
|
126 |
-
$gtag_id = $gaId;
|
127 |
-
}
|
128 |
-
?>
|
129 |
-
<!-- Global site tag (gtag.js) - Google Analytics -->
|
130 |
-
<script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo esc_attr( $gtag_id ); ?>"></script>
|
131 |
-
<script>
|
132 |
-
window.dataLayer = window.dataLayer || [];
|
133 |
-
function gtag(){dataLayer.push(arguments);}
|
134 |
-
gtag('js', new Date());
|
135 |
-
gtag('config', '<?php echo esc_attr( $gtag_id ); ?>');
|
136 |
-
</script>
|
137 |
-
<?php
|
138 |
-
}
|
139 |
-
} // if ( $gaId ) {
|
140 |
}
|
|
1 |
<?php
|
2 |
+
/*
|
3 |
+
Add setting page
|
4 |
/*-------------------------------------------*/
|
5 |
|
6 |
function vkExUnit_add_ga_options_page() {
|
7 |
// require dirname( __FILE__ ) . '/ga_admin.php';
|
8 |
+
require_once dirname( __FILE__ ) . '/ga_admin.php';
|
9 |
}
|
10 |
// カスタマイザー読み込み
|
11 |
+
require_once dirname( __FILE__ ) . '/ga_customizer.php';
|
|
|
12 |
|
13 |
+
/*
|
14 |
+
Options Init
|
15 |
/*-------------------------------------------*/
|
16 |
function vkExUnit_ga_options_init() {
|
17 |
if ( false === vkExUnit_get_ga_options() ) {
|
19 |
}
|
20 |
|
21 |
vkExUnit_register_setting(
|
22 |
+
__( 'Google Analytics Settings', 'vk-all-in-one-expansion-unit' ), // Immediately following form tag of edit page.
|
23 |
'vkExUnit_ga_options', // name attr
|
24 |
'vkExUnit_ga_options_validate',
|
25 |
'vkExUnit_add_ga_options_page'
|
30 |
function vkExUnit_get_ga_options() {
|
31 |
$options = get_option( 'vkExUnit_ga_options', vkExUnit_get_ga_options_default() );
|
32 |
$options_dafault = vkExUnit_get_ga_options_default();
|
33 |
+
|
34 |
+
// UA・GA4 両対応時の互換処理を追加
|
35 |
+
if ( ! empty( $options['gaId'] ) || ! empty( $output['gaType'] ) ) {
|
36 |
+
if ( preg_match( '/G-/', $options['gaId'] ) ) {
|
37 |
+
$options['gaId-GA4'] = $options['gaId'];
|
38 |
+
} elseif ( preg_match( '/UA-/', $options['gaId'] ) ) {
|
39 |
+
$options['gaId-UA'] = $options['gaId'];
|
40 |
+
} else {
|
41 |
+
$options['gaId-UA'] = 'UA-' . $options['gaId'];
|
42 |
+
}
|
43 |
+
unset( $options['gaId'] );
|
44 |
+
unset( $output['gaType'] );
|
45 |
+
update_option( 'vkExUnit_ga_options', $options );
|
46 |
+
}
|
47 |
+
|
48 |
foreach ( $options_dafault as $key => $value ) {
|
49 |
$options[ $key ] = ( isset( $options[ $key ] ) ) ? $options[ $key ] : $options_dafault[ $key ];
|
50 |
}
|
53 |
|
54 |
function vkExUnit_get_ga_options_default() {
|
55 |
$default_options = array(
|
56 |
+
'gaId-GA4' => '',
|
57 |
+
'gaId-UA' => '',
|
58 |
+
'disableLoggedin' => false,
|
59 |
);
|
60 |
+
|
61 |
return apply_filters( 'vkExUnit_ga_options_default', $default_options );
|
62 |
}
|
63 |
|
64 |
+
/*
|
65 |
+
validate
|
66 |
/*-------------------------------------------*/
|
67 |
function vkExUnit_ga_options_validate( $input ) {
|
68 |
// デフォルト値を取得
|
71 |
$input = wp_parse_args( $input, $defaults );
|
72 |
|
73 |
// 入力値をサニタイズ
|
74 |
+
$output['gaId-GA4'] = stripslashes( esc_html( $input['gaId-GA4'] ) );
|
75 |
+
$output['gaId-UA'] = stripslashes( esc_html( $input['gaId-UA'] ) );
|
76 |
+
$output['disableLoggedin'] = ( $input['disableLoggedin'] ) ? true : false;
|
77 |
|
78 |
return apply_filters( 'vkExUnit_ga_options_validate', $output, $input, $defaults );
|
79 |
}
|
80 |
|
81 |
+
/*
|
82 |
+
GoogleAnalytics
|
83 |
/*-------------------------------------------*/
|
84 |
+
function make_ga_script() {
|
85 |
+
$options = vkExUnit_get_ga_options();
|
86 |
+
$gaId_GA4 = esc_html( $options['gaId-GA4'] );
|
87 |
+
$gaId_UA = esc_html( $options['gaId-UA'] );
|
88 |
+
|
89 |
+
// メインの GAID を設定
|
90 |
+
$gaId_main = '';
|
91 |
+
if ( ! empty( $gaId_GA4 ) ) {
|
92 |
+
$gaId_main = $gaId_GA4;
|
93 |
+
} elseif ( ! empty( $gaId_UA ) ) {
|
94 |
+
$gaId_main = $gaId_UA;
|
95 |
+
}
|
96 |
+
|
97 |
+
$disableLoggedin = ( $options['disableLoggedin'] ) ? true : false;
|
98 |
|
99 |
+
$script = '';
|
100 |
+
|
101 |
+
if ( ! empty( $gaId_main ) && ! ( $disableLoggedin && is_user_logged_in() ) ) {
|
102 |
+
$script .= '<!-- Google tag (gtag.js) -->';
|
103 |
+
$script .= '<script async src="https://www.googletagmanager.com/gtag/js?id=' . $gaId_main . '"></script>';
|
104 |
+
$script .= '<script>';
|
105 |
+
$script .= 'window.dataLayer = window.dataLayer || [];';
|
106 |
+
$script .= 'function gtag(){dataLayer.push(arguments);}';
|
107 |
+
$script .= 'gtag(\'js\', new Date());';
|
108 |
+
if ( ! empty( $gaId_GA4 ) ) {
|
109 |
+
$script .= 'gtag(\'config\', \'' . $gaId_GA4 . '\');';
|
110 |
+
}
|
111 |
+
if ( ! empty( $gaId_UA ) ) {
|
112 |
+
$script .= 'gtag(\'config\', \'' . $gaId_UA . '\');';
|
113 |
+
}
|
114 |
+
$script .= '</script>';
|
115 |
+
return $script;
|
116 |
}
|
|
|
117 |
}
|
118 |
|
119 |
+
function load_ga_script() {
|
120 |
+
echo make_ga_script() . PHP_EOL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
}
|
122 |
+
add_action( 'wp_head', 'load_ga_script', 0 );
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Fa
|
|
5 |
Requires at least: 5.3.0
|
6 |
Tested up to: 6.0.2
|
7 |
Requires PHP: 7.2
|
8 |
-
Stable tag: 9.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -81,6 +81,9 @@ e.g.
|
|
81 |
|
82 |
== Changelog ==
|
83 |
|
|
|
|
|
|
|
84 |
= 9.81.3.0 =
|
85 |
[ Bug fix ]Fixed broken function of article structure data on user edit page
|
86 |
|
5 |
Requires at least: 5.3.0
|
6 |
Tested up to: 6.0.2
|
7 |
Requires PHP: 7.2
|
8 |
+
Stable tag: 9.82.0.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
81 |
|
82 |
== Changelog ==
|
83 |
|
84 |
+
= 9.82.0.0 =
|
85 |
+
[ Add Function ][ Google Analytics ] Be able to set Both UA and GA4 tag.
|
86 |
+
|
87 |
= 9.81.3.0 =
|
88 |
[ Bug fix ]Fixed broken function of article structure data on user edit page
|
89 |
|
vendor/autoload.php
CHANGED
@@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
|
9 |
|
10 |
require_once __DIR__ . '/composer/autoload_real.php';
|
11 |
|
12 |
-
return
|
9 |
|
10 |
require_once __DIR__ . '/composer/autoload_real.php';
|
11 |
|
12 |
+
return ComposerAutoloaderInit223b7d1bba5d93766979fcde9dec9280::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -24,12 +24,12 @@ class ComposerAutoloaderInit45d279ff3dcfc67a6b27f25cba05904a
|
|
24 |
|
25 |
require __DIR__ . '/platform_check.php';
|
26 |
|
27 |
-
spl_autoload_register(array('
|
28 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
29 |
-
spl_autoload_unregister(array('
|
30 |
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
-
call_user_func(\Composer\Autoload\
|
33 |
|
34 |
$loader->register(true);
|
35 |
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit223b7d1bba5d93766979fcde9dec9280
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
24 |
|
25 |
require __DIR__ . '/platform_check.php';
|
26 |
|
27 |
+
spl_autoload_register(array('ComposerAutoloaderInit223b7d1bba5d93766979fcde9dec9280', 'loadClassLoader'), true, true);
|
28 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
29 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit223b7d1bba5d93766979fcde9dec9280', 'loadClassLoader'));
|
30 |
|
31 |
require __DIR__ . '/autoload_static.php';
|
32 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit223b7d1bba5d93766979fcde9dec9280::getInitializer($loader));
|
33 |
|
34 |
$loader->register(true);
|
35 |
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'V' =>
|
@@ -46,9 +46,9 @@ class ComposerStaticInit45d279ff3dcfc67a6b27f25cba05904a
|
|
46 |
public static function getInitializer(ClassLoader $loader)
|
47 |
{
|
48 |
return \Closure::bind(function () use ($loader) {
|
49 |
-
$loader->prefixLengthsPsr4 =
|
50 |
-
$loader->prefixDirsPsr4 =
|
51 |
-
$loader->classMap =
|
52 |
|
53 |
}, null, ClassLoader::class);
|
54 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit223b7d1bba5d93766979fcde9dec9280
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'V' =>
|
46 |
public static function getInitializer(ClassLoader $loader)
|
47 |
{
|
48 |
return \Closure::bind(function () use ($loader) {
|
49 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit223b7d1bba5d93766979fcde9dec9280::$prefixLengthsPsr4;
|
50 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit223b7d1bba5d93766979fcde9dec9280::$prefixDirsPsr4;
|
51 |
+
$loader->classMap = ComposerStaticInit223b7d1bba5d93766979fcde9dec9280::$classMap;
|
52 |
|
53 |
}, null, ClassLoader::class);
|
54 |
}
|
vendor/composer/installed.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
'name' => 'vektor-inc/vk-all-in-one-expansion-unit',
|
4 |
-
'pretty_version' => '9.
|
5 |
-
'version' => '9.
|
6 |
-
'reference' => '
|
7 |
'type' => 'project',
|
8 |
'install_path' => __DIR__ . '/../../',
|
9 |
'aliases' => array(),
|
@@ -20,9 +20,9 @@
|
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'vektor-inc/vk-all-in-one-expansion-unit' => array(
|
23 |
-
'pretty_version' => '9.
|
24 |
-
'version' => '9.
|
25 |
-
'reference' => '
|
26 |
'type' => 'project',
|
27 |
'install_path' => __DIR__ . '/../../',
|
28 |
'aliases' => array(),
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
'name' => 'vektor-inc/vk-all-in-one-expansion-unit',
|
4 |
+
'pretty_version' => '9.82.0.0',
|
5 |
+
'version' => '9.82.0.0',
|
6 |
+
'reference' => '42b9df692f7a695570e5c12f5bdadda99460e65a',
|
7 |
'type' => 'project',
|
8 |
'install_path' => __DIR__ . '/../../',
|
9 |
'aliases' => array(),
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'vektor-inc/vk-all-in-one-expansion-unit' => array(
|
23 |
+
'pretty_version' => '9.82.0.0',
|
24 |
+
'version' => '9.82.0.0',
|
25 |
+
'reference' => '42b9df692f7a695570e5c12f5bdadda99460e65a',
|
26 |
'type' => 'project',
|
27 |
'install_path' => __DIR__ . '/../../',
|
28 |
'aliases' => array(),
|
vkExUnit.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: VK All in One Expansion Unit
|
4 |
* Plugin URI: https://ex-unit.nagoya
|
5 |
* Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
|
6 |
-
* Version: 9.
|
7 |
* Requires PHP: 7.2
|
8 |
* Author: Vektor,Inc.
|
9 |
* Text Domain: vk-all-in-one-expansion-unit
|
3 |
* Plugin Name: VK All in One Expansion Unit
|
4 |
* Plugin URI: https://ex-unit.nagoya
|
5 |
* Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
|
6 |
+
* Version: 9.82.0.0
|
7 |
* Requires PHP: 7.2
|
8 |
* Author: Vektor,Inc.
|
9 |
* Text Domain: vk-all-in-one-expansion-unit
|