Skip to content

Commit

Permalink
Merge pull request #6 from stape-io/v2.1.8
Browse files Browse the repository at this point in the history
v2.1.8
  • Loading branch information
Bukashk0zzz authored Sep 15, 2023
2 parents 70491c0 + cd3507c commit a179629
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
5 changes: 4 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: gtmserver,bukashk0zzz
Tags: google tag manager, google tag manager server side, gtm, gtm server side, tag manager, tagmanager, analytics, google, serverside, server-side, gtag
Requires at least: 5.2.0
Tested up to: 6.3.0
Stable tag: 2.1.7
Stable tag: 2.1.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -66,6 +66,9 @@ Yes. <a href="https://stape.io/blog/how-to-set-up-facebook-conversion-api">How t
4. Menu item in the settings panel.

== Changelog ==
= 2.1.8 =
* Changed settings text

= 2.1.7 =
* Tested up to WordPress 6.3

Expand Down
4 changes: 2 additions & 2 deletions gtm-server-side.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* @wordpress-plugin
* Plugin Name: GTM Server Side
* Plugin URI: https://wordpress.org/plugins/gtm-server-side/
* Description: Google Tag Manager Server Side Integration Made Easy
* Version: 2.1.7
* Description: Enhance conversion tracking by implementing server-side tagging using server Google Tag Manager container. Effortlessly configure data layer events in web GTM, send webhooks, set up custom loader, and extend cookie lifetime.
* Version: 2.1.8
* Author: Stape
* Author URI: https://stape.io
* License: GPL-2.0+
Expand Down
43 changes: 28 additions & 15 deletions includes/class-gtm-server-side-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function settings_tab_general() {
$placement = GTM_Server_Side_Helpers::get_option( GTM_SERVER_SIDE_FIELD_PLACEMENT );
add_settings_field(
GTM_SERVER_SIDE_FIELD_PLACEMENT . '-' . GTM_SERVER_SIDE_FIELD_PLACEMENT_VALUE_CODE,
__( 'Add Google Tag Manager web container on all pages', 'gtm-server-side' ),
__( 'Add web GTM script onto every page of your website', 'gtm-server-side' ),
function() use ( $placement ) {
echo '<input
type="radio"
Expand All @@ -87,14 +87,14 @@ class="js-' . esc_attr( GTM_SERVER_SIDE_FIELD_PLACEMENT ) . '"
name="' . esc_attr( GTM_SERVER_SIDE_FIELD_PLACEMENT ) . '"
' . checked( $placement, GTM_SERVER_SIDE_FIELD_PLACEMENT_VALUE_CODE, false ) . '
value="' . esc_attr( GTM_SERVER_SIDE_FIELD_PLACEMENT_VALUE_CODE ) . '">';
esc_html_e( 'Select this option if you want to embed the GTM snippet code on your website', 'gtm-server-side' );
esc_html_e( 'Select this option if you want to embed the web GTM snippet code onto every page of your website.', 'gtm-server-side' );
},
GTM_SERVER_SIDE_ADMIN_SLUG,
GTM_SERVER_SIDE_ADMIN_GROUP_GENERAL
);
add_settings_field(
GTM_SERVER_SIDE_FIELD_PLACEMENT . '-' . GTM_SERVER_SIDE_FIELD_PLACEMENT_VALUE_PLUGIN,
__( 'Update existing GTM snippet', 'gtm-server-side' ),
__( 'Update existing web GTM script', 'gtm-server-side' ),
function() use ( $placement ) {
echo '<input
type="radio"
Expand All @@ -104,7 +104,7 @@ class="js-' . esc_attr( GTM_SERVER_SIDE_FIELD_PLACEMENT ) . '"
' . checked( $placement, GTM_SERVER_SIDE_FIELD_PLACEMENT_VALUE_PLUGIN, false ) . '
' . ( GTM_Server_Side_Helpers::is_plugin_gtm4wp_enabled() ? '' : 'disabled' ) . '
value="' . esc_attr( GTM_SERVER_SIDE_FIELD_PLACEMENT_VALUE_PLUGIN ) . '">';
esc_html_e( 'This option will work if you already have a GTM snippet inserted through another plugin. This option is not enabled if we can\'t find an existing web container', 'gtm-server-side' );
esc_html_e( 'Use this option if you require or have already inserted the web GTM container code manually or through another plugin. In this case GTM Server Side plugin will not add web GTM code onto your website, it will only modify the existing GTM code. This selection becomes available only if the web GTM script has been successfully found on your website.', 'gtm-server-side' );
},
GTM_SERVER_SIDE_ADMIN_SLUG,
GTM_SERVER_SIDE_ADMIN_GROUP_GENERAL
Expand All @@ -120,6 +120,7 @@ class="js-' . esc_attr( GTM_SERVER_SIDE_FIELD_PLACEMENT ) . '"
name="' . esc_attr( GTM_SERVER_SIDE_FIELD_PLACEMENT ) . '"
' . checked( $placement, GTM_SERVER_SIDE_FIELD_PLACEMENT_VALUE_DISABLE, false ) . '
value="' . esc_attr( GTM_SERVER_SIDE_FIELD_PLACEMENT_VALUE_DISABLE ) . '">';
esc_html_e( 'Use this option if you do not want to insert web GTM snippet code onto your website.', 'gtm-server-side' );
},
GTM_SERVER_SIDE_ADMIN_SLUG,
GTM_SERVER_SIDE_ADMIN_GROUP_GENERAL
Expand All @@ -128,7 +129,7 @@ class="js-' . esc_attr( GTM_SERVER_SIDE_FIELD_PLACEMENT ) . '"
register_setting( GTM_SERVER_SIDE_ADMIN_GROUP, GTM_SERVER_SIDE_FIELD_WEB_CONTAINER_ID );
add_settings_field(
GTM_SERVER_SIDE_FIELD_WEB_CONTAINER_ID,
__( 'GTM Web container ID', 'gtm-server-side' ),
__( 'Web Google Tag Manager ID', 'gtm-server-side' ),
function() {
echo '<input
type="text"
Expand All @@ -137,7 +138,7 @@ function() {
pattern="GTM-.*"
value="' . esc_attr( GTM_Server_Side_Helpers::get_option( GTM_SERVER_SIDE_FIELD_WEB_CONTAINER_ID ) ) . '">';
echo '<br>';
_e( 'Enter the ID of your <strong>WEB</strong> container', 'gtm-server-side' ); //phpcs:ignore WordPress.Security.EscapeOutput.UnsafePrintingFunction
esc_html_e( 'Enter the WEB Google Tag Manager ID, should be formatted as "GTM-XXXXXX".', 'gtm-server-side' ); //phpcs:ignore WordPress.Security.EscapeOutput.UnsafePrintingFunction
},
GTM_SERVER_SIDE_ADMIN_SLUG,
GTM_SERVER_SIDE_ADMIN_GROUP_GENERAL
Expand All @@ -146,7 +147,7 @@ function() {
register_setting( GTM_SERVER_SIDE_ADMIN_GROUP, GTM_SERVER_SIDE_FIELD_WEB_CONTAINER_URL );
add_settings_field(
GTM_SERVER_SIDE_FIELD_WEB_CONTAINER_URL,
__( 'GTM server container URL', 'gtm-server-side' ),
__( 'Server GTM container URL', 'gtm-server-side' ),
function() {
echo '<input
type="text"
Expand All @@ -155,7 +156,12 @@ function() {
name="' . esc_attr( GTM_SERVER_SIDE_FIELD_WEB_CONTAINER_URL ) . '"
value="' . esc_attr( GTM_Server_Side_Helpers::get_option( GTM_SERVER_SIDE_FIELD_WEB_CONTAINER_URL ) ) . '">';
echo '<br>';
esc_html_e( 'Enter the URL of your server container in the format: https://gtm.example.com. Alternatively, leave this field blank, in which case the container will load from the standard googletagmanager.com address', 'gtm-server-side' ); //phpcs:ignore WordPress.Security.EscapeOutput.UnsafePrintingFunction
printf(
__( 'If you use <a href="%s" target="_blank">stape.io sGTM hosting</a> you can find sGTM container URL following <a href="%s" target="_blank">this guide</a>. Otherwise you can find sGTM container URL in the <a href="%s" target="_blank">container settings</a>.', 'gtm-server-side' ), // phpcs:ignore
'https://stape.io/gtm-server-hosting',
'https://help.stape.io/hc/en-us/articles/6080905799453-Find-server-container-URL-for-sGTM-container',
'https://developers.google.com/tag-platform/tag-manager/server-side/app-engine-setup#4_add_the_server_url_to_google_tag_manager'
);
},
GTM_SERVER_SIDE_ADMIN_SLUG,
GTM_SERVER_SIDE_ADMIN_GROUP_GENERAL
Expand All @@ -164,7 +170,7 @@ function() {
register_setting( GTM_SERVER_SIDE_ADMIN_GROUP, GTM_SERVER_SIDE_FIELD_WEB_IDENTIFIER );
add_settings_field(
GTM_SERVER_SIDE_FIELD_WEB_IDENTIFIER,
__( 'Stape container identifier or custom loader', 'gtm-server-side' ),
__( 'Stape container identifier', 'gtm-server-side' ),
function() {
echo '<input
type="text"
Expand All @@ -174,10 +180,12 @@ class="js-' . esc_attr( GTM_SERVER_SIDE_FIELD_WEB_IDENTIFIER ) . '"
value="' . esc_attr( GTM_Server_Side_Helpers::get_option( GTM_SERVER_SIDE_FIELD_WEB_IDENTIFIER ) ) . '">';
echo '<br>';
printf(
__( 'If you are using <a href="%s" target="_blank">stape.io</a> - specify the container ID here which you can find in <a href="%s" target="_blank">container settings</a>. <a href="%s" target="_blank">What is this for?</a>','gtm-server-side' ), //phpcs:ignore
'https://stape.io',
__( 'Follow <a href="%s" target="_blank">this guide</a> to find stape container identifier. Stape container identifier is used to activate <a href="%s" target="_blank">custom loader</a> for your web Google Tag Manager script. Custom loader helps to improve the <a href="%s" target="_blank">accuracy of conversion tracking</a>. This feature is available only if you use <a href="%s" target="_blank">stape.io sGTM hosting</a> and enabled <a href="%s" target="_blank">Custom Loader power up</a>.','gtm-server-side' ), //phpcs:ignore
'https://help.stape.io/hc/en-us/articles/9697466601373-How-to-find-the-Stape-container-identifier',
'https://stape.io/blog/avoiding-google-tag-manager-blocking-by-adblockers'
'https://stape.io/solutions/custom-gtm-loader',
'https://stape.io/blog/avoiding-google-tag-manager-blocking-by-adblockers',
'https://stape.io/gtm-server-hosting',
'https://help.stape.io/hc/en-us/articles/6080917962397-Set-up-custom-web-GTM-loader',
);
},
GTM_SERVER_SIDE_ADMIN_SLUG,
Expand All @@ -202,7 +210,12 @@ function() {
' . checked( GTM_Server_Side_Helpers::get_option( GTM_SERVER_SIDE_FIELD_COOKIE_KEEPER ), 'yes', false ) . '
value="yes">';
echo '<br>';
printf( __( 'Activate this option only if you already have this Power-Up set up on Stape.io. <a href="%s" target="_blank">Find out more.</a>', 'gtm-server-side' ), '#' ); //phpcs:ignore
printf(
__( 'Cookie Keeper is used to <a href="%s" target="_blank">prolong cookie lifetime</a> in Safari and other browsers with ITP. This option available only if you use <a href="%s" target="_blank">stape.io sGTM hosting</a> and set up <a href="%s" target="_blank">Cookie Keeper power up</a>.', 'gtm-server-side' ), //phpcs:ignore
'https://stape.io/blog/increase-first-party-cookie-lifetime-set-by-a-third-party-ip',
'https://stape.io/gtm-server-hosting',
'https://stape.io/blog/increase-first-party-cookie-lifetime-set-by-a-third-party-ip#how-cookie-keeper-works'
);
},
GTM_SERVER_SIDE_ADMIN_SLUG,
GTM_SERVER_SIDE_ADMIN_GROUP_GENERAL
Expand Down Expand Up @@ -311,15 +324,15 @@ function() {
register_setting( GTM_SERVER_SIDE_ADMIN_GROUP, GTM_SERVER_SIDE_FIELD_WEBHOOKS_CONTAINER_URL );
add_settings_field(
GTM_SERVER_SIDE_FIELD_WEBHOOKS_CONTAINER_URL,
__( 'GTM server container URL', 'gtm-server-side' ),
__( 'Server GTM container URL', 'gtm-server-side' ),
function() {
echo '<input
type="text"
id="' . esc_attr( GTM_SERVER_SIDE_FIELD_WEBHOOKS_CONTAINER_URL ) . '"
name="' . esc_attr( GTM_SERVER_SIDE_FIELD_WEBHOOKS_CONTAINER_URL ) . '"
value="' . esc_attr( GTM_Server_Side_Helpers::get_option( GTM_SERVER_SIDE_FIELD_WEBHOOKS_CONTAINER_URL ) ) . '">';
echo '<br>';
esc_html_e( 'Enter the URL of your server container in the format: https://gtm.example.com/data', 'gtm-server-side' );
printf( __( 'If you use <a href="%s" target="_blank">stape.io sGTM hosting</a> you can find sGTM container URL following <a href="%s" target="_blank">this guide</a>. Otherwise you can find sGTM container URL in the <a href="%s" target="_blank">container settings</a>.', 'gtm-server-side' ), 'https://stape.io/gtm-server-hosting', 'https://help.stape.io/hc/en-us/articles/6080905799453-Find-server-container-URL-for-sGTM-container', 'https://developers.google.com/tag-platform/tag-manager/server-side/app-engine-setup#4_add_the_server_url_to_google_tag_manager' ); // phpcs:ignore
},
GTM_SERVER_SIDE_ADMIN_SLUG,
GTM_SERVER_SIDE_ADMIN_GROUP_WEBHOOKS
Expand Down

0 comments on commit a179629

Please sign in to comment.